Table Of Contents

dec_to_base

Version:
    Last Modified: March 15, 2017

    Converts a decimal number to a base b number represented by a string.

    Syntax

    d = dec_to_base(a, b)
    d = dec_to_base(a, b, c)
    Legacy name: dec2base

    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

    Base to which you want to convert a. b can be any integer between 2 and 36.

    c

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

    Outputs

    d

    Base b number equivalent to a with at least c digits. The base b notation uses the following digits: 0, 1, ... , 9, A, B, ... , Z. d is a string.

    A = 2562525
    D = dec_to_base(A, 36)

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: This product does not support FPGA devices


    Recently Viewed Topics