mirror of
https://github.com/lcn2/calc.git
synced 2025-08-22 01:23:28 +03:00
Release calc version 2.10.2t30
This commit is contained in:
43
help/isset
Normal file
43
help/isset
Normal file
@@ -0,0 +1,43 @@
|
||||
NAME
|
||||
isset - whether a given binary bit is set in a value
|
||||
|
||||
SYNOPSIS
|
||||
isset(x, y)
|
||||
|
||||
TYPES
|
||||
x real
|
||||
y int
|
||||
|
||||
return int
|
||||
|
||||
DESCRIPTION
|
||||
Determine if the binary bit y is set in x. If:
|
||||
|
||||
x
|
||||
int(---) mod 2 == 1
|
||||
2^y
|
||||
|
||||
return 1, otherwise return 0.
|
||||
|
||||
EXAMPLE
|
||||
> print isset(9,0), isset(9,1), isset(9,2), isset(9,3)
|
||||
1 0 0 1
|
||||
|
||||
> print isset(9,4), isset(0,0), isset(9,-1)
|
||||
0 0 0
|
||||
|
||||
> print isset(1.25, -2), isset(1.25, -1), isset(1.25, 0)
|
||||
1 0 1
|
||||
|
||||
> p = pi()
|
||||
> print isset(p, 1), isset(p, -2), isset(p, -3)
|
||||
1 0 1
|
||||
|
||||
LIMITS
|
||||
-2^31 < y < 2^31
|
||||
|
||||
LIBRARY
|
||||
BOOL qisset(NUMBER *x, long y)
|
||||
|
||||
SEE ALSO
|
||||
highbit, lowbit
|
Reference in New Issue
Block a user