GLBasic forum

Main forum => GLBasic - en => Topic started by: Hot Dog Hero on 2013-Jun-16

Title: # = a float (4 bytes) or a double (8 bytes)?
Post by: Hot Dog Hero on 2013-Jun-16
How do you determine (while a program is running) if variables declared with a # are a float (4 bytes) or a double (8 bytes)?
Title: Re: # = a float (4 bytes) or a double (8 bytes)?
Post by: Hot Dog Hero on 2013-Jun-16
Ok.  Thank you for your help.
Title: Re: # = a float (4 bytes) or a double (8 bytes)?
Post by: MrTAToad on 2013-Jun-16
You shouldn't really need to know.  If however, you do for some reason, you would need to use INLINE C code.
Title: Re: # = a float (4 bytes) or a double (8 bytes)?
Post by: hardyx on 2013-Jun-16
It's float in mobile and limited resources platforms (ARM), and double in desktop platforms.
I think you can use the GLB platform defines.
Title: Re: # = a float (4 bytes) or a double (8 bytes)?
Post by: kanonet on 2013-Jun-16
Like MrT said you can use sizeof() in inline to know what is used - or you force GLB to always use floats on your variable, instead of LOCAL a# just call LOCAL a AS float. So you know that you always use a float - but be aware that you cannot use some GLB functions with this variable or if you can, you add "slow downs" cause of typecasting.