Difference between revisions of "Bit.bswap"
From GiderosMobile
Line 2: | Line 2: | ||
'''Available since:''' Gideros 2013.09<br/> | '''Available since:''' Gideros 2013.09<br/> | ||
=== Description === | === Description === | ||
− | Swaps the bytes of its argument and returns it. This can be used to convert little-endian 32 bit numbers to big-endian 32 bit numbers or vice versa. | + | <translate>Swaps the bytes of its argument and returns it. This can be used to convert little-endian 32 bit numbers to big-endian 32 bit numbers or vice versa.</translate> |
<source lang="lua"> | <source lang="lua"> | ||
(number) = bit.bswap(x) | (number) = bit.bswap(x) | ||
</source> | </source> | ||
=== Parameters === | === Parameters === | ||
− | '''x''': (number) number to swap <br/> | + | '''x''': (number) <translate>number to swap</translate> <br/> |
=== Return values === | === Return values === | ||
− | '''Returns''' (number) Swapped bytes<br/> | + | '''Returns''' (number) <translate>Swapped bytes</translate><br/> |
Revision as of 13:34, 23 August 2018
Available since: Gideros 2013.09
Description
Swaps the bytes of its argument and returns it. This can be used to convert little-endian 32 bit numbers to big-endian 32 bit numbers or vice versa.
(number) = bit.bswap(x)
Parameters
x: (number) number to swap
Return values
Returns (number) Swapped bytes