the
bc
of
(
expression ,
sourceBase ,
destinationBase )
bc
(
expression ,
sourceBase ,
destinationBase )
Expression yields a string
. SourceBase and destinationBase yield positive integer
s between 2 and 36, inclusive.
put bc("09F91102", 16, 10) into myNumber
The bc
function converts a real or complex number in any base, or radix, to the same number in another base. For example, bc("FF",16,10)
gives "255"
, and bc("255",10,16)
gives "FF"
.
If the given sourceBase or destinationBase is less than 2 or greater than 36, a script error is triggered.