BASIC

Author Topic: # = a float (4 bytes) or a double (8 bytes)?  (Read 1191 times)

Offline Hot Dog Hero

  • Mc. Print
  • *
  • Posts: 2
    • View Profile
How do you determine (while a program is running) if variables declared with a # are a float (4 bytes) or a double (8 bytes)?

Offline Hot Dog Hero

  • Mc. Print
  • *
  • Posts: 2
    • View Profile
Ok.  Thank you for your help.

MrTAToad

  • Guest
You shouldn't really need to know.  If however, you do for some reason, you would need to use INLINE C code.

Offline hardyx

  • Community Developer
  • Dr. Type
  • ******
  • Posts: 490
    • View Profile
It's float in mobile and limited resources platforms (ARM), and double in desktop platforms.
I think you can use the GLB platform defines.

Offline kanonet

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1142
    • View Profile
    • My GLBasic code archiv
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.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64