Host introspection: Difference between revisions

Content added Content deleted
(To find the word size, replaced the computation using log2 by a call to "countSetBits" from module "bitops".)
Line 687: Line 687:


=={{header|Nim}}==
=={{header|Nim}}==
In Nim, "int" type has the size of the word. So, to find the word size, just count the number of bits set in the "int" -1.
<lang nim>import bitops
<lang nim>import bitops
echo cpuEndian
echo cpuEndian