Hi.
I'm trying to perform the following calculation:
$value = ($float + $integer) * 100000;
$string = "$value:test";
Here, I know $float has a resolution of millionths. That is, $float
multiplied by 1,000,000 should be an integer. However, $float is very
large, and multiplying by 1,000,000 causes it to exceed perl's integer
range. Thus I would like to use Math::BigInt, but I am having trouble
getting it to work with the floating point value.
For example, if $value is 1234567890123456.123456, and $integer is
1, then I want the final resulting string $string to be
"1234567890123457123456:test".
When I tried using BigInt with floating point numbers like $float, I
end up with NaN and then get errors like:
Can't locate object method "badd" via package "NaN"...
Any ideas on how to do this conversion simply? Thanks.
+ Richard J. Barbalace
<[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]