punch_card_don has asked for the wisdom of the Perl Monks concerning the following question:
In my script:
$a, $b, $c and $d are integers retrieved from a db query,
$e = $a*sqrt($b/$c)
$f = $d - $e
Output from my script says:
$d = 66
$e = 35.0127321335217
$f = 1451.98726786648
So I suspect I need to straighten out my integers and floating points. Best way to do this?
Thanks.
Forget that fear of gravity,
Get a little savagery in your life.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Odd results from mixing integer and floating point math?
by gargle (Chaplain) on Aug 21, 2005 at 17:03 UTC | |
by punch_card_don (Curate) on Aug 21, 2005 at 17:12 UTC | |
by rinceWind (Monsignor) on Aug 21, 2005 at 20:07 UTC | |
by northwind (Hermit) on Aug 22, 2005 at 00:20 UTC | |
|
Re: Odd results from mixing integer and floating point math?
by tilly (Archbishop) on Aug 22, 2005 at 06:26 UTC |