Manuals/calci/OCT2BIN
Jump to navigation
Jump to search
OCT2BIN(number, places)
- Where Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle number} is the octal integer to be converted and
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle places} is the number of characters to display the output.
OCT2BIN() function converts an octal number to its binary equivalent.
Description
OCT2BIN(number, places)
For example,
OCT2BIN(15, 4) returns 1101
OCT2BIN(7.5,5) returns 00111
OCT2BIN(30,5.5) returns 011000
- The Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle number} should be in the range '7777777000' for negative numbers to '777' for positive numbers. If it exceeds the limit, Calci gives a #NUM! error.
- If Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle number} is not an integer, Calci truncates the value and uses the integer part as input.
- Calci returns an #N/A error, when the Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle number} is nonnumeric.
- For a negative number, Calci ignores the places and displays a 10 bit binary output. Most significant bit is the sign bit and remaining are magnitude bits.
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle places} argument is used to return the output with leading zeros. If Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle places} argument is not used, 'Calci' uses the minimum number of characters required to display the binary output.
- If Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle places} is negative, Calci ignores the places and displays a 10 bit binary output.
- If Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle places} is not an integer, Calci truncates the value and uses the integer part as input.
- A number preceding with '0' (e.g. 077) should be written in text format ("077") to avoid confusion with hexadecimal numbers.
Examples
| Function | Binary Output |
| OCT2BIN(75,8) | 00111101 |
| OCT2BIN(10.5,4) | 1000 |
| OCT2BIN(100) | 0001000000 |
| OCT2BIN(-56) | 1111010010 |
| OCT2BIN(757,-10) | 111101111 |