At 04:07 PM 7/24/05 -0400, John Deighan wrote:
>Sorry about the lack of sample code, but I know that people who work 
>with floating point numbers know about this problem, and I was 
>wondering what the best solution was. Here is sample code with 

Well ur right, the easy answer is to do the $diff < .0001 route.  If you
really want the hard core way, be prepared to engage in some heavy wizardy
and/or pain.  What u have to do is basically take over numeric processing
from perl and do everything in scientific notation.  Then provide all ur own
arithmetic functions.  Of course I'm sure somebody has already implemented a
module to do this.  Numbers will then be represented as two element arrays
of an integer and an integer power of ten.  2.35 = 235*10^-2 = (235, -2).
Bye bye floats.  U can override the builtin math operators or provide
functions.  Another outside thing u can do is do everything in base 210
numbers.  Why 210?  It's the product of all the prime numbers less than 10
so it can eliminate run-on fractions.  But I digress.







--
REMEMBER THE WORLD TRADE CENTER         ---=< WTC 911 >=--
"...ne cede males"

00000100

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to