Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Influencing the Gconvert macro

by syphilis (Archbishop)
on Sep 30, 2020 at 12:16 UTC ( [id://11122363]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    /* Gconvert:
     *    This preprocessor macro is defined to convert a floating point
    ...
     *        d_Gconvert='sprintf((b),"%.*g",(n),(x))'
     *    The last two assume trailing zeros should not be kept.
     */
    
  2. or download this
    $ perl -le 'printf "%.54g\n", 0.3;'
    0.29999999999999999
    
  3. or download this
    0.299999999999999988897769753748434595763683319091796875
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11122363]
Approved by hippo
Front-paged by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-11-06 10:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    chatterbot is...






    Results (32 votes). Check out past polls.