Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: What causes NaN when using bignum

by BrowserUk (Patriarch)
on May 25, 2011 at 09:12 UTC ( [id://906614]=note: print w/replies, xml ) Need Help??


in reply to What causes NaN when using bignum

Your code produces 8.5 on my 64-bit/5.10 install.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: What causes NaN when using bignum
by Microcebus (Beadle) on May 25, 2011 at 09:20 UTC
    This is curious. On my 64bit with Perl 5.12.1 it produces NaN?!?

      What output do you get from this on your system?

      #! perl -slw use bignum; $number = 330978816.3082480433473810957254665863937; $number =( int( ( ( log( $number ) / log( 10 ) ) * 10 ) + 0.5 ) ) / 10 +; print"$number\n"; print "$k -> $v" while ( $k, $v ) = each %INC; __END__ c:\test>junk 8.5 XSLoader.pm -> C:/Perl64/lib/XSLoader.pm re.pm -> C:/Perl64/lib/re.pm Math/BigInt/FastCalc.pm -> C:/Perl64/lib/Math/BigInt/FastCalc.pm warnings/register.pm -> C:/Perl64/lib/warnings/register.pm bigint.pm -> C:/Perl64/lib/bigint.pm C:/Perl64/site/lib/sitecustomize.pl -> C:/Perl64/site/lib/sitecustomiz +e.pl ActiveState/Path.pm -> C:/Perl64/lib/ActiveState/Path.pm Cwd.pm -> C:/Perl64/site/lib/Cwd.pm warnings.pm -> C:/Perl64/lib/warnings.pm Config_git.pl -> C:/Perl64/lib/Config_git.pl File/Basename.pm -> C:/Perl64/lib/File/Basename.pm Config.pm -> C:/Perl64/lib/Config.pm integer.pm -> C:/Perl64/lib/integer.pm ActivePerl/Config.pm -> C:/Perl64/lib/ActivePerl/Config.pm Math/BigFloat.pm -> C:/Perl64/lib/Math/BigFloat.pm Carp.pm -> C:/Perl64/lib/Carp.pm Math/BigInt.pm -> C:/Perl64/lib/Math/BigInt.pm Exporter/Heavy.pm -> C:/Perl64/lib/Exporter/Heavy.pm bignum.pm -> C:/Perl64/lib/bignum.pm Exporter.pm -> C:/Perl64/lib/Exporter.pm strict.pm -> C:/Perl64/lib/strict.pm vars.pm -> C:/Perl64/lib/vars.pm Math/BigInt/Calc.pm -> C:/Perl64/lib/Math/BigInt/Calc.pm constant.pm -> C:/Perl64/lib/constant.pm Config_heavy.pl -> C:/Perl64/lib/Config_heavy.pl overload.pm -> C:/Perl64/lib/overload.pm AutoLoader.pm -> C:/Perl64/lib/AutoLoader.pm DynaLoader.pm -> C:/Perl64/lib/DynaLoader.pm

      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (1)
As of 2024-04-25 12:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found