keep in mind javascript is required for full website functionality.
Esta función convierte un número decimal (base 10) a binario (base two).
The DEC2BIN The function uses the following syntax to operate:
DEC2BIN (number, [places])
The DEC2BIN The function has the following arguments:
- number: esto es obligatorio y representa el entero decimal que desea convertir. And number is negative, los valores posicionales válidos se ignoran y DEC2BIN devuelve un número binario de 10 characters (10 bits) en el que el bit más significativo es el bit de signo. The 9 bits restantes son bits de magnitud. Los números negativos se representan mediante notación en complemento a dos
- places: this argument is optional. Este es el número de caracteres a utilizar. And places is omitted, DEC2BIN use the minimum number of characters necessary. The argument places it is useful for padding the return value with leading zeros.
Two's complement is a mathematical operation on binary numbers, así como una representación de números binarios con signo basada en esta operación. The two's complement of a North-número de bits se define como el complemento con respecto a 2North; in other words, is the result of subtracting the number of 2North. Esto también equivale a tomar el complemento de unos y luego sumar uno, ya que la suma de un número y el complemento de sus unos es 1 bits. The two's complement of a number behaves like the negative of the original number in most arithmetic operations, and positive and negative numbers can coexist naturally.
It should also be noted that:
- And number <-512 o si number > 511, DEC2BIN return the #ON ONE! error value
- And number it is not numeric, DEC2BIN return the #VALUE! error value
- And DEC2BIN requiere más de places characters, return the #ON ONE! error value
- And places it is not a whole number, is truncated
- And places it is not numeric, DEC2BIN return the #VALUE! error value
- And places es cero o negativo, DEC2BIN return the #ON ONE! error value.
Please, see my example below:
Soon we will continue with our functions from A to Z of Excel. Keep checking: there is a new blog post every business day.
You can find a full page of feature articles here.
Sign up to receive our newsletter