Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: perl floating number addition

by poolpi (Hermit)
on Jul 20, 2009 at 06:57 UTC ( #781545=note: print w/ replies, xml ) Need Help??


in reply to perl floating number addition

May be of interest ;)

#!/usr/bin/perl use strict; use warnings; use Math::BigFloat; my $base = Math::BigFloat->new(q{895.3}); my $incr = Math::BigFloat->new(q{0.01}); while ( $base->bcmp(900) ) { print $base->bstr(), "\n"; $base->badd($incr); }


hth,
PooLpi

'Ebry haffa hoe hab im tik a bush'. Jamaican proverb


Comment on Re: perl floating number addition
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://781545]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (13)
As of 2015-07-01 21:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (22 votes), past polls