Table Of Contents

dec_to_bin

Version:
    Last Modified: March 15, 2017

    Converts a decimal number to a binary number represented by a string.

    Syntax

    c = dec_to_bin(a)
    c = dec_to_bin(a, b)
    Legacy name: dec2bin

    Inputs

    a

    Vector or matrix with decimal numbers. a is an integer between 0 and 2^52-1. MathScript rounds a if a is not an integer.

    b

    Controls the number of digits in c. If c has fewer than b digits, MathScript pads the beginning of c with zeros until it reaches b digits. b is an integer.

    Outputs

    c

    Binary number equivalent to a. Valid binary digits are 0 and 1. c is a string.

    A = 2562525
    C = dec_to_bin(A)

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: This product does not support FPGA devices


    Recently Viewed Topics