This is part of the HicEst documentation
IAND: Bitwise Logical AND
The AND function is used to set the result bit when both bits of its 2 arguments are set, otherwise the bit is zero.
⇾Home
⇾Contents
⇾more Programming
⇾ Examples
Bookmarks:
⇾clear_bit_n
⇾logically_and_bits
⇾test_bit_n
to
logically_and_bits
:
result = IAND( x, y )
result is a logical AND on corresponding bits
result = IAND( 2, 3 )
! result is set to 2:
2 == 0000000000000000000000000000000000000000000000000000000000000010
3 == 0000000000000000000000000000000000000000000000000000000000000011
result = IAND( 2, -1 )
! result is set to 2:
2 == 0000000000000000000000000000000000000000000000000000000000000010
-1 == 1111111111111111111111111111111111111111111111111111111111111111
IAND to
clear_bit_n
:
result = IAND(argument,
NOT
(2^n))
! with n = 0 ... 53
clearbit0 = IAND( bits0and2,
NOT
(2^0) )
! evaluates to 4
IAND to
test_bit_n
:
result = IAND(argument, 2^n) /= 0
! with n = 0 ... 53
bit3set = IAND( bits0and2, 2^3)
! evaluates to 0
precision is a normalized 53-bit fraction of the 8-byte IEEE T_floating format
IOR
to
set bit
n:
result =
IOR
(argument, 2^n)
! with n = 0 ... 53
bits0and2 =
IOR
(2^0, 2^2)
! is set to 1 + 4 = 5
NOT
to
toggle bits
of argument:
result =
NOT
( argument )
⇾
Support HicEst
⇾
Impressum
©2000-2019 Georg Petrich, HicEst Instant Prototype Computing. All rights reserved.