"AG" == Adam Ginsburg <[EMAIL PROTECTED]> writes:

AG> I have a strange problem that seems not to be isolated to PDL, but
AG> causes problems when using PGPLOT.

AG> I'm making a postscript plot, but when I try to plot certain values
AG> (e.g. -.360000000000001), it makes a bad plot - specifically, it makes
AG> an irrational bounding box (44 -154618798 154619554327).

Do you get the same problem if you include the leading zero?

(ie  -0.360000000000001)

I wonder whether this is a parsing error somewhere.


AG> I've found out that the reason I have such a weird value is that
AG> apparently linux (kernel vers. 2.6.17-11-386) does something weird
AG> with some values.  Example:
AG> 9.37-9.73 = -.360000000000001 instead of -.36
AG> 1.1-1.2=-0.0999999999999
AG> 1.10-1.20 = same
AG> 1.10-1.21 = -.11

This is different from your question above.

man perlnumber

[...]


       Perl can internally represent numbers in 3 different ways: as native
       integers, as native floating point numbers, and as decimal strings.
       Decimal strings may have an exponential notation part, as in
       "12.34e-56".  Native here means "a format supported by the C compiler
       which was used to build perl".

       The term "native" does not mean quite as much when we talk about
       native integers, as it does when native floating point numbers are
       involved.  The only implication of the term "native" on integers is
       that the limits for the maximal and the minimal supported true inte-
       gral quantities are close to powers of 2.  However, "native" floats
       have a most fundamental restriction: they may represent only those
       numbers which have a relatively "short" representation when converted
       to a binary fraction.  For example, 0.9 cannot be represented by a
       native float, since the binary fraction for 0.9 is infinite:

         binary0.1110011001100...



(etc etc, you can look up the rest)


Aloha,

        Frossie


_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to