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 / How to achieve more digits of precision in Tier 1?

Author
Message
Kakise
AGK Tool Maker
8
Years of Service
User Offline
Joined: 25th May 2016
Location: Paris
Posted: 3rd Jan 2019 10:47
Hello,

I have a question: when dealing with real numbers that needs to have more than 7 digits of precision, the float vars glitch out and makes using them totally impossible. In C#, to avoid this, you can use double or decimal to avoid it. In C++ there are some double128 libraries too if you're using MSVC.

The thing is: I don't want to use Tier 2 just to write a small program that would depend on 128bits double. So is there a way to use these types of variables in Tier 1?

Thank you.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 3rd Jan 2019 11:27
Unless someone has written a plugin the answer is no
The reason I think doubles are left out of AppGameKit has allot to do with the way mobiles work
and floats are allot quicker to process. If someone wrote a plugin you would have to use
all of the mathematics functions with it IE add subtract etc to make use of the doubles.
With some clever math trickery it should also be possible to do this I think with strings
if you only want to do math calculations, there are several math functions on the forum
so perhaps do a search and see what you can find

Good luck






fubar
Kakise
AGK Tool Maker
8
Years of Service
User Offline
Joined: 25th May 2016
Location: Paris
Posted: 3rd Jan 2019 15:09
I've followed your advice and put together a really basic plugin.

It is attached and even has an example with it. It currently only works with Windows 64 bits.

Tell me what you think about it :p

Attachments

Login to view attachments
Rick Nasher
7
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 3rd Jan 2019 18:36
That's pretty cool for astronomy sims (orbit calculations etc).

Something to put on the wishlist for AppGameKit?

Login to post a reply

Server time is: 2024-11-23 08:51:28
Your offset time is: 2024-11-23 08:51:28