diff --git a/reference/math/functions/decbin.xml b/reference/math/functions/decbin.xml index f8ac5202f4..92ef4226eb 100644 --- a/reference/math/functions/decbin.xml +++ b/reference/math/functions/decbin.xml @@ -1,5 +1,5 @@ - + decbin @@ -13,8 +13,7 @@ Returns a string containing a binary representation of the given - number argument. The largest number that can be converted is - 4294967295 in decimal resulting to a string of 32 1's. + number argument. @@ -27,6 +26,135 @@ Decimal value to convert + + + Range of inputs on 32-bit machines + + + + + + + positive number + negative number + return value + + + + + 0 + + 0 + + + 1 + + 1 + + + 2 + + 10 + + + ... normal progression ... + + + 2147483646 + + 1111111111111111111111111111110 + + + 2147483647 (largest signed integer) + + 1111111111111111111111111111111 (31 1's) + + + 2147483648 + -2147483648 + 10000000000000000000000000000000 + + + ... normal progression ... + + + 4294967294 + -2 + 11111111111111111111111111111110 + + + 4294967295 (largest unsigned integer) + -1 + 11111111111111111111111111111111 (32 1's) + + + +
+ + + Range of inputs on 64-bit machines + + + + + + + positive number + negative number + return value + + + + + 0 + + 0 + + + 1 + + 1 + + + 2 + + 10 + + + ... normal progression ... + + + 9223372036854775806 + + 111111111111111111111111111111111111111111111111111111111111110 + + + 9223372036854775807 (largest signed integer) + + 111111111111111111111111111111111111111111111111111111111111111 (31 1's) + + + + -9223372036854775808 + 1000000000000000000000000000000000000000000000000000000000000000 + + + ... normal progression ... + + + + -2 + 1111111111111111111111111111111111111111111111111111111111111110 + + + + -1 + 1111111111111111111111111111111111111111111111111111111111111111 (64 1's) + + + +
+ @@ -69,6 +197,11 @@ echo decbin(26); decoct dechex base_convert + + printf or sprintf + using %b, %032b or + %064b as the format +