.. highlightlang:: us .. index:: bit_set .. _bit_set: bit_set ======= .. us.tag bit_set NOTREADYENGLISH bit-ops New5510 :ref:`bit_set` sets the bit position *nBit* of *m* to 0 (off) or 1 (on). .. function:: m = bit_set(m, nBit) m = bit_set(m, nBit, cast) m = bit_set(m, nBit, bool, cast) .. us.return **Return Value** *m* is an integer matrix. .. us.params **Parameters** .. uparam:: m *m* is an integer matrix. .. uparam:: nBit *nBit* is the bit position starting with 0. For 32-Bit values all bits can be used (0..31). For 64 bit values only the bits 0 to 52 can be used. .. uparam:: cast *cast* is one of the following values: .. list-table:: :header-rows: 0 * - CAST_INT8 (0) - * - CAST_UINT8 (1) - * - CAST_INT16 (2) - * - CAST_UINT16 (3) - * - CAST_INT32 (4) - * - CAST_UINT32 (5) - * - CAST_INT64 (6) - * - CAST_UINT64 (7) - default value. .. us.comment **Comment** UniScript uses double precision floating-point values. When casted to a ``CAST_INT64`` or ``CAST_UINT64`` only the lower 53 Bits (Bit 0 .. Bit 52) can be used. .. us.example **Example** :: m = 0; m = bit_set(m, 40) m = bit_set(m, 31, CAST_UINT32) // bit 31 wieder löschen m = bit_set(m, 31, 0, CAST_UINT32) .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - R2013.10 - New. .. seealso:: :ref:`bit-ops`, :ref:`bit_get`, :ref:`bit_and`, :ref:`bit_or`, :ref:`bit_xor`, :ref:`bit_not`, :ref:`bit_lshift`, :ref:`bit_rshift` :sub:`id-1110941`