Octals and Hexadecimals
The following are examples of octal
Positive octal numbers must begin with
(zero) followed by octal digit(s).
Negative octal numbers must begin with
followed by octal digit(s).
And these are examples of hexadecimal
Positive hexadecimals must begin with
and negative hexadecimals must begin with
When you need to convert an octal or hexadecimal string to a number, use the function
. Consider these examples:
The second argument of
specifies the base of the number whose representation is contained in the original string. This argument can be any integer from 2 to 36.