Big and small numbers.

For questions about using Classic.

Post » Tue Jun 21, 2011 1:29 am

Hello!

I'm trying to calculate orbital periods for planets, and so far I have two options.

1) fudge it! using orbital periods for a sun size star.

2) calculate it.

the problem with option 2 is just the huge numbers involved. Is there a way in construct to store excessively large or small numbers.
B
2
G
1
Posts: 13
Reputation: 476

Post » Tue Jun 21, 2011 2:42 am

[quote:410xqhgh]Is there a way in construct to store excessively large or small numbers.[/quote:410xqhgh]
Construct uses floating point numbers so it should handle it just as well as any other program.
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Tue Jun 21, 2011 1:19 pm

I thought it did, perhaps I need to set the numbers using the float(x) expression as they just seem to hitting 0 currently. which is awesome when my program tries to divide by it.
B
2
G
1
Posts: 13
Reputation: 476

Post » Wed Jun 22, 2011 7:42 pm

You can also use python to do the calculations as I think it may use higher precision floating point numbers.

And if that still isn't accurate enough you could try the python decimal module which allows extremely high precision floating point calculation and storage.
http://docs.python.org/library/decimal.html
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Wed Jun 22, 2011 10:46 pm

thanks I will look into it. In the long run it might be better to fudge the values anyhow from a practical point of view. In game this it is fairly unimportant. It would be nice to include it as a feature but I am already having to streamline calculations to decrease loading times.
B
2
G
1
Posts: 13
Reputation: 476


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests