3 registered members (TipmyPip, AndrewAMD, dBc),
18,430
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
no decimal places
#440688
04/30/14 04:01
04/30/14 04:01
|
Joined: Apr 2005
Posts: 1,988 Canadian, Eh
DLively
OP
Serious User
|
OP
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
Hello  I would like to know how to tell the engine, that if a variable has a deciamal place to round to the lowest number? is there a simple code to do this? :?
|
|
|
Re: no decimal places
[Re: DLively]
#440690
04/30/14 05:32
04/30/14 05:32
|
Joined: Jan 2006
Posts: 33 California
Amanda_Dearheart
Newbie
|
Newbie
Joined: Jan 2006
Posts: 33
California
|
Im not sure about A8's implementation of lite c, but c++ has instructions for rounding numbers named round, floor, ceil, and trunc.
im unsure what round and trunc does, but floor always round down while ceil always round up.
Prepare to be assimilated. Resistance is futile
Amanda Dearheart
Business E-mail : cjw.roberson@gmail.com
|
|
|
Re: no decimal places
[Re: Amanda_Dearheart]
#440734
04/30/14 17:53
04/30/14 17:53
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
im unsure what round and trunc does round() rounds to the nearest integer in halfway cases. trunc() rounds to the nearest integer that is not greater in magnitude than the input.
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|