On this page:
Default Decimal Format, Short Number Format, Apostrophe Format, Output Format Commands, Seeing Results with 18 Digits, Converting Decimal/Hexadecimal/Binary, Notes.
By default, Hypatia shows integer numbers with up to 18 digits and floating point numbers with up to 15 digits.
When numbers are very small or very large, they are shown in scientific notation.
Hypatia's format commands let you chose different output formats.
All format commands begin with the letter F.
Format commands only affect the way results are shown, they do not change their actual values.
In many cases seeing results with up to 15 digits is more of a distraction than a desired feature. When such accuracy is not required, you can chose to see only a maximum of 9 digits.
FSHORT sets the maximum number of significant floating point digits to 9.
FLONG sets the maximum number of significant floating point digits back to the default of 15.
You can add the command FSHORT to the file hy.ini to make 9 digits the default.
By default Hypatia structures numbers with more than 3 digits before the decimal point by inserting apostrophes every three digits (every 4 digits for hexadecimal numbers, every 8 digits for binary numbers).
The command F' OFF turns this feature off, F' ON turns it on, F' toggles it.
(This is different behavior from other ON/OFF commands, which display their status when used without ON or OFF.)
If you want apostrophe format disabled by default, add the line F' OFF to the file hy.ini.
You can use apostrophes in numbers that you write, they will simply be ignored.
FDEC means default decimal format, scientific notation for large or small numbers.
FDEC n means show results with n digits after the decimal point.
FDEC -n means show results with n digits before the decimal point.
FDEC 0 means show numbers without decimal digits (that is, rounded to integer).
FSCI means show results in scientific notation with 15 digits (9 digits with FSHORT) and exponent.
FHEX means show results in hexadecimal format (only positive integer numbers, the maximum is 12 hexadecimal digits).
FHEX n means hexadecimal format, with at least n digits (n must be 2 to 12).
FBIN means show results in binary format (only positive integer numbers, the maximum is 48 binary digits).
FBIN n means binary format, with at least n digits (n must be 2 to 48).
FLAKH means decimal format, numbers greater or equal one hundred thousand are shown in lakh, numbers greater or equal ten million in crore.
FMILLION means decimal format, numbers greater or equal one million are shown in million.
Independent of the currently chosen format, the command == displays the last result with up to 18 digits, even if it is a floating point number.
Note that with floating point numbers anything beyond 15 significant digits may be inaccurate.
It is very simple to convert between decimal, hexadecimal and binary numbers:
Set the format into which you want to convert by using the format commands FDEC (which is default), FHEX or FBIN, then enter the number in the format from which you want to convert, using the &H or &B prefixes for hexadecimal or binary numbers.
You can also enter the number first and give the format command afterwards, but then you have to give the command $ before you can copy the result to the clipboard with COPY. This will be discussed later.
When numbers cannot be shown in the chosen format, they are shown in the default decimal format.
When you give a format command, the last result is shown in the chosen format, if possible. The format commands do not update the result fily hy, though.
To update hy with the result in the currently chosen format you have to use the command $.
$ by itself, unlike any other single value or variable which are trivial calculations, is a command!
The command $ is not allowed in a script.
The command = shows the recent result in the currently chosen format.