tur/bits
stdlib/bits.tur
bitwise operations not expressible as arithmetic in Turmeric.
Since: Phase B1
defn
bit-shr
(bit-shr [x :int n :int] :int)
logical (unsigned) right shift of x by n bits.
Parameters
| x | value to shift | |
| n | number of bit positions to shift right |
Returns
x shifted right by n bits (unsigned/logical shift; 0-fills high bits).
Example
(bit-shr -1 1) ; => 9223372036854775807 (fills with 0, not sign bit)
Since: Phase B1
defn
println-float
(println-float [x :float decimals :int] :nil)
print a float with the specified number of decimal places.
Parameters
| x | floating-point value to print | |
| decimals | number of decimal places (clamped to 0--17) |
Returns
:nil
Example
(println-float 3.14159 6) ; prints "3.141590"
Since: Phase B1