Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Influencing the Gconvert macro

by syphilis (Archbishop)
on Sep 30, 2020 at 12:16 UTC ( #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? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2022-05-24 12:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (82 votes). Check out past polls.

    Notices?