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 / float and half float

Author
Message
basjak
14
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 4th Dec 2014 14:02
HI guys:

Just a technical question about how AppGameKit deals with floating points before I start my project.

does AppGameKit deals with:
32 bit float (important for my project);
or
16 bit float or half float (I can deal with it but will end up loosing plenty of precision);
or
AppGameKit decides for us depends on the system (best of both worlds).

thanks

CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 4th Dec 2014 14:38
You should be able to find what you need in the help (under Home>Principles>Data Types). A "Real" number has a range: 3.4E +/- 38 (7 digits).

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 4th Dec 2014 15:17
With that range, it'll be a DWord float.

Typically an integer or float will use DWords, it's the safe standard to assume, DWord or 4 bytes. As 64-bit is not standard across all devices, it probably wouldn't be supported in AppGameKit, really for anything but DWord storage you need to do your own handling.

So, assume DWords for numbers no matter whether they're integers or floats.

I am the one who knocks...
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 4th Dec 2014 18:28
Floats in AppGameKit are single-precision (32-bit). I don't think it's much to do with 64-bits - it's a OpenGL thing. Using Tier 2 or Pascal you can used double or extended for your own calculations and then reduce them to singles before passing to AGK.

-- Jim - When is there going to be a release?

Login to post a reply

Server time is: 2024-11-25 13:32:14
Your offset time is: 2024-11-25 13:32:14