Bit32.replace

From GiderosMobile
Revision as of 19:23, 22 January 2023 by MoKaLux (talk | contribs) (Created page with "__NOTOC__ '''Available since:''' Gideros 2022.3<br/> '''Class:''' bit32<br/> === Description === Returns a copy of a number with a range of bits replaced by a given value...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Available since: Gideros 2022.3
Class: bit32

Description

Returns a copy of a number with a range of bits replaced by a given value.

(number) = bit32.replace(n,v,field,width)
Returns a copy of n with the bits field to field + width - 1 replaced by the value v. See bit32.extract() for details about field and width

Parameters

n: (number) number value
v: (number) replace by value
field: (number) field value
width: (number) width value optional, default value 1

Return values

Returns (number) copy of n with range of bits replaced

See also

Bitwise Operators