Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Dividing and format

by kilinrax (Deacon)
on Nov 27, 2003 at 14:01 UTC ( #310537=note: print w/replies, xml ) Need Help??


in reply to Dividing and format

printf / sprintf is the obvious way, and given they are builtin functions, I see no reason not to use them.

Want to give us a slightly fuller description of the problem and reasons for the restriction before this gets branded as homework? ;)

Replies are listed 'Best First'.
Re: Re: Dividing and format
by hotshot (Prior) on Nov 27, 2003 at 14:06 UTC
    I don't need to display the result, I first want to store the result, do some calculations with it and than display another result.

      Normally, intermediate calculations are done without rounding, to gain maximum accuracy - you round at the end for display purposes. If for some reason you actually need to round the number for intermediate calculations, then you use sprintf.

      --
      3dan

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2022-01-22 17:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (63 votes). Check out past polls.

    Notices?