help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Same .m file: different results with different versions of Octave


From: Thomas D. Dean
Subject: Re: Same .m file: different results with different versions of Octave
Date: Sat, 17 Apr 2010 20:57:57 -0700

>lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 9.10
Release:        9.10
Codename:       karmic

>uname -a
Linux asus 2.6.31-20-generic-pae #58-Ubuntu SMP Fri Mar 12 06:25:51 UTC
2010 i686 GNU/Linux

>g++ trig.cc -o trig

>./trig
libc version 2.10.1
arg       (50000,50000)
sinh(arg) (-inf,-inf)
cosh(arg) (-inf,-inf)
s/c       (nan,nan)
tanh(arg) (0,0)

>cat trig.cc
// trig.cc
#include <iostream>
#include <complex>
#include <gnu/libc-version.h>
using namespace std;
int main(int argc, char **argv) {
  complex<double> arg(50000,50000);
  complex<double> s,c,r,t;
  s=sinh(arg);
  c=cosh(arg);
  r=s/c;
  t=tanh(arg);
  cout << "libc version " << gnu_get_libc_version() << endl;
  cout << "arg       " << arg << endl;
  cout << "sinh(arg) " << s << endl;
  cout << "cosh(arg) " << c << endl;
  cout << "s/c       " << r << endl;
  cout << "tanh(arg) " << t << endl;
  return 0;
}





reply via email to

[Prev in Thread] Current Thread [Next in Thread]