Host introspection: Difference between revisions
Content added Content deleted
(→{{header|MATLAB}} / {{header|Octave}}: host introspection) |
(→{{header|Retro}}: add Retro example) |
||
Line 636: | Line 636: | ||
Endianness |
Endianness |
||
<lang R>.Platform$endian # e.g. "little"</lang> |
<lang R>.Platform$endian # e.g. "little"</lang> |
||
=={{header|Retro}}== |
|||
These introspections are possible through the standard '''variations''' library. |
|||
Word Size |
|||
<lang Retro>needs variations' |
|||
^variations'size</lang> |
|||
Returns the number of bits per cell. This is normally 32, though may be smaller or larger on embedded systems and under special cases. |
|||
Endianness |
|||
<lang Retro>needs variations' |
|||
^variations'endian</lang> |
|||
Returns 0 for little endian, and 1 for big endian. |
|||
=={{header|Ruby}}== |
=={{header|Ruby}}== |