Difference between revisions of "Manuals/calci/DEC2BIN"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
− | =DEC2BIN(number, | + | =DEC2BIN(number, places)= |
*Where 'number' is the decimal integer to be converted and | *Where 'number' is the decimal integer to be converted and | ||
− | *' | + | *'places' is the number of characters to display the output. |
DEC2BIN() function converts a decimal number to its binary equivalent. | DEC2BIN() function converts a decimal number to its binary equivalent. | ||
Line 9: | Line 9: | ||
== Description == | == Description == | ||
− | DEC2BIN(number, | + | DEC2BIN(number, places) |
*The 'number' should be in the range -512 to 511. If it exceeds the limit, Calci gives a #NUM! error. | *The 'number' should be in the range -512 to 511. If it exceeds the limit, Calci gives a #NUM! error. | ||
Line 15: | Line 15: | ||
*DEC2BIN returns an #ERROR, when the 'number' is nonnumeric. | *DEC2BIN returns an #ERROR, when the 'number' is nonnumeric. | ||
− | *' | + | *'places' argument is used to return the output with leading zeros. If 'places' argument is not used, 'Calci' uses the minimum number of characters required to display the binary output. |
<!-- | <!-- | ||
− | *DEC2BIN returns #NUM! error, whenever the ' | + | *DEC2BIN returns #NUM! error, whenever the 'places' is nonnumeric, zero or negative. |
--> | --> | ||
− | *If ' | + | *If 'places' contains decimal value, Calci truncates the decimal point and uses the integer value as input. |
For example, | For example, |
Revision as of 11:43, 16 November 2013
DEC2BIN(number, places)
- Where 'number' is the decimal integer to be converted and
- 'places' is the number of characters to display the output.
DEC2BIN() function converts a decimal number to its binary equivalent.
Description
DEC2BIN(number, places)
- The 'number' should be in the range -512 to 511. If it exceeds the limit, Calci gives a #NUM! error.
- DEC2BIN returns an #ERROR, when the 'number' is nonnumeric.
- 'places' argument is used to return the output with leading zeros. If 'places' argument is not used, 'Calci' uses the minimum number of characters required to display the binary output.
- If 'places' contains decimal value, Calci truncates the decimal point and uses the integer value as input.
For example,
DEC2BIN(10, 4) returns 1010
DEC2BIN(100) returns 0001100100
DEC2BIN(30,5.5) returns 011110
Examples
Function | Binary Output |
DEC2BIN(10) | 0000001010 |
DEC2BIN(10,4) | 1010 |
DEC2BIN(100,8) | 01100100 |
DEC2BIN(-56) | 1111001000 |
DEC2BIN(-512) | 1000000000 |