[Israel.pm] Fwd: number imprecision

Levenglick Dov-RM07994 dovl at freescale.com
Sun Sep 3 01:08:02 PDT 2006


The explanation is that the number you got may or may not have been 1.
remember that perl calculates in floating point. 


 
Best Regards,
Dov Levenglick
DSP SoC System and Applications Engineer,
Network and Computing Systems Group
Freescale Semiconductor Israel
Tel. +972-9-952-2804
The information contained in this email is classified as:
[x] Freescale General Business Information
[ ] Freescale Internal Use Only
[ ] Freescale Confidential Proprietary
[ ] Personal Memorandum

-----Original Message-----
From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il] On
Behalf Of Michael Gang
Sent: Sunday, September 03, 2006 10:50
To: perl at perl.org.il
Subject: [Israel.pm] Fwd: number imprecision

Dear All,

I have encountered a strange calculation in perl.
I have a value which i get in the function ($x ) and his value is 1 .
Now i show from the debugger a snippet.

DB<3> x $x
0  1
DB<4> x 1-$x
 '-2.22044604925031e-16'



Has anyone an explanation of it how 1-1=  '-2.22044604925031e-16' ?

Thanks in advance,
Michael
_______________________________________________
Perl mailing list
Perl at perl.org.il
http://perl.org.il/mailman/listinfo/perl




More information about the Perl mailing list