Number Bases & Scientific Notation
Notes Calculator accepts numbers written in scientific notation, hexadecimal,
binary, and octal. You can also ask any result to render in those formats with
an in / as postfix.
Scientific notation literals
Section titled “Scientific notation literals”Use e (or E) to write a number in scientific notation. The exponent
sign is optional.
| Calculation | Result |
|---|---|
1.5e6 | 1,500,000 |
2.5E-3 to 4 dp | 0.0025 |
5e+3 | 5,000 |
1e10 | 10,000,000,000 |
Scientific literals participate in arithmetic exactly like any other number:
| Calculation | Result |
|---|---|
1.5e6 + 1 | 1,500,001 |
1.5e6 * 2 | 3,000,000 |
Hex, binary, and octal literals
Section titled “Hex, binary, and octal literals”Prefix integer literals with 0x (hex), 0b (binary), or 0o
(octal). The prefix and digits are case-insensitive.
| Calculation | Result |
|---|---|
0xFF | 255 |
0xDEADBEEF | 3,735,928,559 |
0b1010 | 10 |
0b11111111 | 255 |
0o17 | 15 |
0O377 | 255 |
Mix bases freely in expressions:
| Calculation | Result |
|---|---|
0xFF + 1 | 256 |
0b1010 + 5 | 15 |
Display postfix: in / as
Section titled “Display postfix: in / as”Append in <format> or as <format> to a number or expression to
choose how the result is displayed. The underlying value is unchanged.
Only the rendering is affected.
| Calculation | Result |
|---|---|
255 in hex | FF |
255 in binary | 11111111 |
255 in octal | 377 |
1234567 as scientific | 1.234567e6 |
1234567 as fixed | 1,234,567 |
Both in and as are accepted, and as decimal is an alias for
as fixed.
The postfix attaches to the whole expression on its left, so parentheses can be used to format an arithmetic result:
| Calculation | Result |
|---|---|
(0xFF + 1) in hex | 100 |
(0b1010 + 5) in binary | 1111 |
in hex, in binary, and in octal require an integer value: with a
non-integer the line shows nothing.
Converting between number systems
Section titled “Converting between number systems”A number can also carry its base as a unit, written as a subscript (₂,
₈, ₁₀, ₁₆) or a name such as binary or decimal (see the
Unit Reference). Convert it with
in:
| Calculation | Result |
|---|---|
11₂ in ₁₀ | 3 |
255₁₀ in ₁₆ | FF |
11 binary in decimal | 3 |
255 decimal in hex | FF |
Global default format
Section titled “Global default format”The default format for numeric results is set in Settings → Number format:
- Auto: plain decimal for everyday values; switches to scientific for very large or very small numbers. (Default.)
- Scientific: every number renders in scientific notation.
- Fixed: every number renders as a plain decimal, never in scientific notation.
A per-line as scientific / as fixed postfix always overrides the
global setting.
Very small numbers keep their significant digits instead of rounding down to
0.00:
| Calculation | Result |
|---|---|
0.0001 | 0.0001 |
1/3000 | 0.00033 |
0.000012345 | 1.23e-5 |
1 µg in mg | 0.001 mg |