Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Exploring IEEE754 floating point bit patterns.

by BrowserUk (Pope)
on Jul 29, 2012 at 06:46 UTC ( #984270=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        printf("%f %f\n",       inf / inf, -(inf / inf)); // -1.#IND00 -1.
    +#IND00
        printf("%.4f %.4f\n",   inf / inf, -(inf / inf)); // -1.#IND -1.#I
    +ND
        printf("%.10f %.10f\n", inf / inf, -(inf / inf)); // -1.#IND000000
    + -1.#IND000000
    
  2. or download this
        printf("%g %g\n", inf / inf, -(inf / inf));      // -1.#IND -1.#IN
    +D
    
  3. or download this
    print +( 10.0**20 + 1 ) - 10.0**20;;
    0
    
    print +( 10.0**20 - 10.0**20 ) + 1;;
    1
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://984270]
help
Chatterbox?
[erix]: in this context, one learns all kinds of interesting psychological excuse-jargon: not just 'alternative facts'; how about 'gapped knowledge' ? :)
[erix]: which still manages to sound more or less positive
[Corion]: Huh. I wasn't aware that you cannot segregate Python 2 and Python 3 modules... Hopefully Perl 6 module use C6AN and thus avoid the problem...
[hippo]: I very much hope so.
[moritz]: there are already some (very few) Perl 6 modules on CPAN, but in a way that the p5 indexer avoids them
[hippo]: It's confusing enough to have the Perl6:: namespace which isn't for Perl6 but for features from that ported into Perl.

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (13)
As of 2017-01-24 09:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (203 votes). Check out past polls.