Arith HighBit, Arith LowBit
Aus ExpeccoWiki
(Weitergeleitet von Arith highBit)
Inhaltsverzeichnis |
Schema
Description
HighBit returns the bitNumber (1..) of the highest bit of its integral input value. If no bit is set (an input value of 0), an output value of 0 is generated.
LowBit returns the bitNumber (1..) of the lowest bit of its integral input value. If no bit is set (an input value of 0), an output value of 0 is generated.
Examples
| Input | HighBit | LowBit |
| 0 | 0 | 0 |
| 1 | 1 | 1 |
| 2 | 2 | 2 |
| 4 | 3 | 3 |
| 5 | 3 | 1 |
| 6 | 3 | 2 |
| 7 | 3 | 1 |
| 8 | 4 | 4 |
| factorial(100) | 525 | 98 |
Revisions
These blocks have been added with 1.7.2.
Back to StandardLibrary.
Previous: Arith [ Pi, E ]
Next: Arith [ LeftShift ]

