Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Long and double unsigned integers?

Author
Message
Impetus73
13
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 7th Oct 2014 14:47
Tier 1, how can I store enormous numbers, like 100000000000000000000000000000000 in a variable?

I can only find integer, and float, as variable datatypes.

Is there a datatype for big numbers?

----------------
AGK programmer
Did Amiga / AMOS programming in the 90's.
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 7th Oct 2014 15:13
Simple answer: no.

For compatibility with older OpenGL libraries, AppGameKit uses 32-bit integers and floats.

-- Jim - When is there going to be a release?
Marl
13
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 7th Oct 2014 15:26 Edited at: 7th Oct 2014 15:28
Quote: "Tier 1, how can I store enormous numbers, like 100000000000000000000000000000000 in a variable?"

You could put them in strings.

Of course if you wanted to do any maths on them, you would have to write your own routines, but it's do-able.

I had a play a while back

Attachments

Login to view attachments
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 7th Oct 2014 16:08
thats a sweet calculator marl! lol!

i have no idea why anyone would need such big values...but cool i guess its possible anyways. nice work!

Impetus73
13
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 7th Oct 2014 16:26
It has to do with possible combinations in a matrix.

A 1 bit colored 8x8 block of pixels, can show 18446744073709551616 different patterns. ( 2^64 )

I'm making a program for making a "timeline" of all possible patterns in a block, and then the program can display any pattern, just by referencing the right number along that line. You can drag the line, and zoom in to find specific patterns.

Think about it, if you take a TV display, and you display all possible combinations of pixels and colors, you will eventually see EVERYTHING possible and impossible. Yes it will take a gazillion times the lifetime of the universe, and then some, but it is a defined finite set of possible combinations, varying from all pixels black, to all pixels white. in between there is EVERYTHING. You can use the timeline, to jump gazilliontrillions of frames at a time, and then hunt for recognizable pictures, and fine tune until you get it right. Who knows what you will see.

To start with, I want to try it on very small blocks of black and white, but even then, the integer is to small... I might need all the computer in the world to scale it up to just a small picture, but I need to start somewhere...

----------------
AGK programmer
Did Amiga / AMOS programming in the 90's.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 7th Oct 2014 17:57
some 64bit data type can also be useful if u not using open gl.
for example fractal calculating.
ok,the math functions must be extend.

AGK 108 (B)19 + AppGameKit V2 Alpha .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 7th Oct 2014 19:21
64-bit integers are very useful in a vast range of circumstances. So are double or extended precision floats.

In Impetus' case, a 64-bit unsigned cardinal contains all of his values.

-- Jim - When is there going to be a release?
Impetus73
13
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 7th Oct 2014 21:57
I will try to do it by using "manageable chunks", and then add them together. One integer for the thousands, one for the millions, and so on, to form one long number.

----------------
AGK programmer
Did Amiga / AMOS programming in the 90's.

Login to post a reply

Server time is: 2024-11-25 10:29:46
Your offset time is: 2024-11-25 10:29:46