mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Release calc version 2.10.2t30
This commit is contained in:
29
help/highbit
Normal file
29
help/highbit
Normal file
@@ -0,0 +1,29 @@
|
||||
NAME
|
||||
highbit - index of highest bit in binary representation of integer
|
||||
|
||||
SYNOPSIS
|
||||
highbit(x)
|
||||
|
||||
TYPES
|
||||
x nonzero integer
|
||||
|
||||
return integer
|
||||
|
||||
DESCRIPTION
|
||||
If x is a nonzero integer, highbit(x) returns the index of the
|
||||
highest bit in the binary representation of abs(x). Equivalently,
|
||||
highbit(x) = n if 2^n <= abs(x) < 2^(n + 1); the binary
|
||||
representation of x then has n + 1 digits.
|
||||
|
||||
EXAMPLE
|
||||
> print highbit(2), highbit(3), highbit(4), highbit(-15), highbit(2^27)
|
||||
1 1 2 3 27
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
||||
LIBRARY
|
||||
LEN zhighbit(ZVALUE x);
|
||||
|
||||
SEE ALSO
|
||||
lowbit, digits
|
Reference in New Issue
Block a user