Number Bases and Integer Modes
Radix Quest supports binary, octal, decimal, and hexadecimal arithmetic. It also provides fixed-width integer operations with signed and unsigned interpretations.
Number Base Reference
| Base | Name | Digits |
|---|---|---|
| 2 | Binary | 0–1 |
| 8 | Octal | 0–7 |
| 10 | Decimal | 0–9 |
| 16 | Hexadecimal | 0–9, A–F |
Prefixed Literals
Use prefixes to identify integer bases explicitly.
| Prefix | Base | Example |
|---|---|---|
0b | Binary | 0b1111 |
0o | Octal | 0o17 |
0x | Hexadecimal | 0xF |
| None | Decimal by default | 15 |
All four examples represent the decimal value 15.
Input Base Selector
The Input base selector provides:
- Auto
- Binary
- Octal
- Decimal
- Hex
Auto Mode
Auto recognizes explicit 0x, 0b, and 0o prefixes and treats ordinary integers as decimal.
Explicit Input Bases
In Integer / Bitwise mode, selecting a base changes how unprefixed integer literals are interpreted.
For example:
Expression: 1010
Input base: Binary
Mode: Integer / BitwiseThe value represents decimal 10.
Explicit prefixes continue to identify their own bases.
Important Parsing Detail
The implementation converts unprefixed non-decimal integer literals through JavaScript parseInt() before converting to BigInt.
This can lose precision for very large values.
For large exact integer literals, prefer explicit 0x, 0b, or 0o prefixes, or decimal literals in Auto mode.
Primary Display Base
Choose the preferred result representation.
| Option | Output |
|---|---|
| Decimal | Base 10 |
| Binary | Base 2 |
| Octal | Base 8 |
| Hex | Base 16 |
| Show all bases | Multiple representations |
In Integer / Bitwise mode, the result area also shows the bit pattern.
Floating-Point vs Integer Mode
| Capability | Floating-Point | Integer / Bitwise |
|---|---|---|
| Decimal fractions | Yes | No |
| Trigonometric functions | Yes | No |
| Logarithms | Yes | No |
| Fixed-width masking | No | Yes |
| Bitwise operators | No | Yes |
| BigInt arithmetic | No | Yes |
| Signed/unsigned interpretation | No | Yes |
Bit Widths
Integer mode provides four selectable widths.
| Width | Unsigned Range | Signed Range |
|---|---|---|
| 8-bit | 0 to 255 | -128 to 127 |
| 16-bit | 0 to 65,535 | -32,768 to 32,767 |
| 32-bit | 0 to 4,294,967,295 | -2,147,483,648 to 2,147,483,647 |
| 64-bit | 0 to 18,446,744,073,709,551,615 | -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 |
Signed Integers
When Signed is enabled, Radix Quest interprets the result using two's complement.
For an 8-bit example:
Expression: 255
Bit width: 8
Signed: EnabledResult:
-1Binary:
1111 1111Unsigned Integers
Disable Signed to interpret the same bit pattern as a nonnegative integer.
Expression: 255
Bit width: 8
Signed: DisabledResult:
255Fixed-Width Overflow
Integer results are masked to the selected bit width.
For example:
Mode: Integer / Bitwise
Bit width: 8
Signed: Disabled
Expression: 255+1Result:
0The mathematical result 256 exceeds the unsigned 8-bit range, so the stored result wraps to zero.
Negative Values
Negative values are represented using fixed-width two's complement.
Example:
Expression: -1
Bit width: 8Underlying bit pattern:
1111 1111The decimal display depends on the Signed setting.
Multi-Base Output
Select Show all bases to display:
- Signed decimal
- Unsigned decimal
- Hexadecimal
- Octal
- Binary
The bit visualization groups digits into sets of four.
Example
For decimal 255 in 8-bit mode:
Hex: 0xFF
Oct: 0o377
Bin: 0b1111_1111
Bits: 1111 1111Floating-Point Base Display
Floating-point mode can display other bases when the result is a safe integer.
For non-integer results, the implementation does not convert fractional digits into binary, octal, or hexadecimal representations.
Recommendations
Use Floating-point mode for general mathematics and scientific calculations.
Use Integer / Bitwise mode for binary arithmetic, bit masks, fixed-width representations, and programmer-oriented operations.
Important: BigInt provides exact integer arithmetic internally, but Radix Quest deliberately masks integer values to the selected width. It is not an unlimited-width integer calculator.
Updated 7 days ago
