| lzSetOutputBaseThe lzSetOutputBase function determines which number base will be used to represent numeric results formatted by Elzed. By default, Elzed expresses numbers in base ten. void lzSetOutputBase( | char cOutputBaseCode | | // character code for output base |
);
ParameterscOutputBaseCode | | The character code must be one of the following values:
Code |
Constant |
Effect |
'B'
|
kBase2 |
Use base 2 for numeric output. |
'O'
|
kBase8 |
Use base 8 for numeric output. |
'D'
|
kBase10 |
Use base 10 for numeric output. |
'T'
|
kBase12 |
Use base 12 for numeric output. |
'H'
|
kBase16 |
Use base 16 for numeric output. |
While passing the code character itself will work, passing the constant is a better idea long term. |
Return Value
Remarks | This function may be called at any time. It affects only the current context. The designated output base remains in effect until changed with another call to this function.
Note that this function affects only the output base. Any properly designated base may be used to convey an input numeric value. The default input base is always base 10.
Unlike most calculators, Elzed will show the fractional parts of numbers in bases other than 10. The same radix mark is used in all bases, though calling it the "decimal point" is technically incorrect in bases other than 10.
The current output base can be set from within Elzed by using the binary, octal, decimal, duodec, and hex operators. |
Versions | Introduced in Elzed 1.0.0 | | This page describes the version of lzSetOutputBase active in Elzed 2.5.0 (106: 2.5.0) |
See Also |