I don't know about Matlab or similar products, but in Fortran (and other
languages), the math is all done in the system's floating point or
integer formats. The resulting values can be printed in whatever bases
are supported by the available I/O library routines.