[EMAIL PROTECTED] wrote:
>>#!/usr/bin/perl -wl
>>use Math::BigFloat;
>>$x = 37.75;
>>print $x - 33.67 - 4.08;
>>$x = Math::BigFloat->new('37.75');
>>print $x - 33.67 - 4.08;
This seems to work, although there are some odd line returns
You mean the automatic "\n" with every
|
| cc:
|
| Subject:
| cc: [EMAIL PROTECTED]
|
| Subject: Re: trouble with math... driving me nuts.
|
>--|
[EMAIL PROTECTED] wrot
[EMAIL PROTECTED] wrote:
print 37.75 - 33.67 - 4.08 ;
;
I find these things all the time. Is there a particular module I can use
to fix these things?
Take a look at Math::BigFloat, it's an arbitrary length float math package:
#!/usr/bin/perl -wl
use Math::BigFloat;
$x = 37.75;
Barker
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 21, 2003 3:06 PM
> To: [EMAIL PROTECTED]
> Subject: trouble with math... driving me nuts.
>
>
> Luckily I was easily able to recreate the problem. See code belo
MAIL PROTECTED]'" <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
|
| cc:
[EMAIL PROTECTED] wrote:
> Luckily I was easily able to recreate the problem. See code below:
>
> print 37.75 - 33.67 - 4.08 ;
> ;
>
> I find these things all the time. Is there a particular
> module I can use
> to fix these things?
>
> Output is
>
> -1.77635683940025e-015
>
Luckily I was easily able to recreate the problem. See code below:
print 37.75 - 33.67 - 4.08 ;
;
I find these things all the time. Is there a particular module I can use
to fix these things?
Output is
-1.77635683940025e-015
Should be 0
Running on Win2000 / Intel P3
-Pete