Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Why does perl math suck?

by ikegami (Patriarch)
on Jan 12, 2011 at 00:27 UTC ( [id://881789]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ cat a.c
    #include <stdio.h>
    ...
    
    $ gcc -o a a.c && a
    Stop blaming Perl for your own mistakes!
    
  2. or download this
    $ perl -e'printf "%.20e\n", $_ for @ARGV' 0.45 0.92 0.37
    4.50000000000000011102e-01
    9.20000000000000039968e-01
    3.69999999999999995559e-01
    
  3. or download this
    $ perl -le 'print abs(5056.45 + 10112.92 - 15169.37) < 0.0001 ? "as ex
    +pected" : "perl math sucks!"'
    as expected
    
    $ perl -le 'print sprintf("%.4f", 5056.45 + 10112.92) eq sprintf("%.4f
    +", 15169.37) ? "as expected" : "perl math sucks!"'
    as expected
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2024-04-18 16:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found