Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
what type of variable to go beyond 2,5 billion ? #437851
02/27/14 11:58
02/27/14 11:58
Joined: May 2008
Posts: 257
D
djfeeler Offline OP
Member
djfeeler  Offline OP
Member
D

Joined: May 2008
Posts: 257
Hello,

I have a problem :

I would like a type of variable to go beyond 2,5 billion.

Type Size Range Minimum Precision*
var, fixed | 4 bytes | -1048577.999 to 1048576.999** | 0.001 | ~9
int, long | 4 bytes | -2147483648 to 2147483647 | 1 | ~10

With var and int I can't to go beyond 2,5 billion. what type of variable choose ?

Thanks in advance

Djfeeler

Last edited by djfeeler; 02/27/14 11:58.
Re: what type of variable to go beyond 2,5 billion ? [Re: djfeeler] #437854
02/27/14 12:23
02/27/14 12:23
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
here you can find the available stuff:
http://www.conitec.net/beta/aarray.htm


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: what type of variable to go beyond 2,5 billion ? [Re: sivan] #437856
02/27/14 13:22
02/27/14 13:22
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
long long int?
Also why do you need such hight values? Which value is minimum for your needs? Probably an integer * 1000000000 will help

Last edited by Ch40zzC0d3r; 02/27/14 13:23.
Re: what type of variable to go beyond 2,5 billion ? [Re: Ch40zzC0d3r] #437860
02/27/14 13:55
02/27/14 13:55
Joined: May 2008
Posts: 257
D
djfeeler Offline OP
Member
djfeeler  Offline OP
Member
D

Joined: May 2008
Posts: 257
Thanks for your help ^^. I need 10 billions.

Re: what type of variable to go beyond 2,5 billion ? [Re: djfeeler] #437863
02/27/14 14:25
02/27/14 14:25
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Roll your own 64bit integer. It's pretty much like 32bit arithmetic, except that you need to take care of the carry yourself. Gives you access to 1.8446744074×10^19 numbers.

An alternative would be double (don't use float), the largest integer you can represent without running into rounding errors is 2^53+1.

long long int and the likes doesn't exist in Lite-C, neither does the concept of an unsigned variable. 32 bit integers is all you get before you have to look into alternatives.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: what type of variable to go beyond 2,5 billion ? [Re: WretchedSid] #437864
02/27/14 14:34
02/27/14 14:34
Joined: May 2008
Posts: 257
D
djfeeler Offline OP
Member
djfeeler  Offline OP
Member
D

Joined: May 2008
Posts: 257
Thanks for you explanation ^^


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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