Re: I don't like the intro page of the documentation.
- Posted by mattlewis (admin) Jun 06, 2013
- 2798 views
jaygade said...
_tom said...
"Use the integer data-type (a special case of the atom) when speed and low memory use are important."
Clarification: In Euphoria, there is no size advantage to using a integer over an atom. Atoms which are within the integer range (and have no fractional part) take up the same amount of space.
This is incorrect. An atom stored as floating point (which can happen for any number of reasons) is really a pointer to a struct that contains a floating point value, a reference count and another pointer:
struct d { /* a double precision number */ eudouble dbl; /* double precision value */ int ref; /* reference count */ cleanup_ptr cleanup; /* custom clean up when sequence is deallocated */ }; /* total 16 bytes */
Of course, this is 16-bytes only on 32-bit euphoria.
Matt