Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 859 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
no decimal places #440688
04/30/14 04:01
04/30/14 04:01
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Hello laugh


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? :?


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
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 Offline
Newbie
Amanda_Dearheart  Offline
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] #440694
04/30/14 06:27
04/30/14 06:27
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Thanks Amanda, Ill look into the manual with that new information laugh


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: no decimal places [Re: DLively] #440695
04/30/14 06:31
04/30/14 06:31
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
okay, so I already knew this one laugh

floor()


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.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 Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Originally Posted By: Amanda_Dearheart
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

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1