comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Rounding off
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Rounding off [message #70590] Thu, 22 April 2010 09:59 Go to previous message
Bob[3] is currently offline  Bob[3]
Messages: 60
Registered: December 2006
Member
On Apr 21, 4:17 pm, bala murugan <bala2...@gmail.com> wrote:
> Suppose i have the following,
>
> r = RANDOMU(SEED,1)
>
> and if the result is 0.423832.
>
> How do i round it off to 0.42 ??

When considering the all the answers given, it might be a good chance
to review the differences between ROUND, FLOOR, and CEIL.

try: print, round(r*100.)/100., floor(r*100.)/100., ceil(r*100.)/100.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: isurface madness?
Next Topic: baffling syntax error

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Nov 29 00:47:19 PST 2025

Total time taken to generate the page: 0.01457 seconds