Floating point print problems

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Floating point print problems

Andrew D. Fernandes

Last week I posted a note about my difficulty in getting octave
to print out a nice, clean 1.000000000000000000e+00.

The problem seems to be in the printing routines:

octave:1> format long e
octave:2> x = 1
x =  1.00000047683363e+00
octave:3> x .^ 100
ans =  1.00000047683363e+00
octave:4> quit

seems to be about the norm.

I am using the precompiled octave available from ftp.che.utexas.edu
for irix 4.0.5.

As long as calculations are done accurately internally, this isn't really
a major bug. What concerns me is if you are relying on saving and loading
floating point data often... the printf and scanf routines could be
doing some strange things then...

-Andrew. ([hidden email])



Reply | Threaded
Open this post in threaded view
|

Re: Floating point print problems

U-E59264-Osman Buyukisik

Reply | Threaded
Open this post in threaded view
|

Re: Floating point print problems

U-E59264-Osman Buyukisik
In reply to this post by Andrew D. Fernandes
>>>>> "Andrew" == Andrew D Fernandes <andrew%watsci.uwaterloo.ca> writes:

    Andrew> Last week I posted a note about my difficulty in getting
    Andrew> octave to print out a nice, clean
    Andrew> 1.000000000000000000e+00.

    Andrew> The problem seems to be in the printing routines:

    Andrew> octave:1> format long e
    Andrew> octave:2> x = 1
    Andrew> 1.00000047683363e+00 octave:3> x .^ 100 ans =
    Andrew> 1.00000047683363e+00 octave:4> quit

    Andrew> seems to be about the norm.

Using Linux octave 1.0 , I get a clean 1.00000000000e+00

Also get the same result using HP710/HPUX9.3. I think maybe the
compiler used in building octave is messing up! Try using "gcc".

Osman