math: fix docs for next-power-of-2 and some tests.
parent
986714489d
commit
ede21dfb56
|
@ -407,7 +407,7 @@ HELP: number
|
||||||
|
|
||||||
HELP: next-power-of-2
|
HELP: next-power-of-2
|
||||||
{ $values { "m" "a non-negative integer" } { "n" "an integer" } }
|
{ $values { "m" "a non-negative integer" } { "n" "an integer" } }
|
||||||
{ $description "Outputs the smallest power of 2 greater than " { $snippet "m" } ". The output value is always at least 2." } ;
|
{ $description "Outputs the smallest power of 2 greater than or equal to " { $snippet "m" } ". The output value is always at least 2." } ;
|
||||||
|
|
||||||
HELP: power-of-2?
|
HELP: power-of-2?
|
||||||
{ $values { "n" integer } { "?" "a boolean" } }
|
{ $values { "n" integer } { "?" "a boolean" } }
|
||||||
|
|
|
@ -86,3 +86,10 @@ IN: math.tests
|
||||||
{ -0x3fffffffffffffff } [ 0x3ffffffffffffffe >bignum bitnot ] unit-test
|
{ -0x3fffffffffffffff } [ 0x3ffffffffffffffe >bignum bitnot ] unit-test
|
||||||
{ -0x4000000000000000 } [ 0x3fffffffffffffff >bignum bitnot ] unit-test
|
{ -0x4000000000000000 } [ 0x3fffffffffffffff >bignum bitnot ] unit-test
|
||||||
{ -0x4000000000000001 } [ 0x4000000000000000 >bignum bitnot ] unit-test
|
{ -0x4000000000000001 } [ 0x4000000000000000 >bignum bitnot ] unit-test
|
||||||
|
|
||||||
|
{ 2 } [ 0 next-power-of-2 ] unit-test
|
||||||
|
{ 2 } [ 1 next-power-of-2 ] unit-test
|
||||||
|
{ 2 } [ 2 next-power-of-2 ] unit-test
|
||||||
|
{ 4 } [ 3 next-power-of-2 ] unit-test
|
||||||
|
{ 4 } [ 4 next-power-of-2 ] unit-test
|
||||||
|
{ 8 } [ 5 next-power-of-2 ] unit-test
|
||||||
|
|
Loading…
Reference in New Issue