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

BaseNameDigits
2Binary0–1
8Octal0–7
10Decimal0–9
16Hexadecimal0–9, A–F

Prefixed Literals

Use prefixes to identify integer bases explicitly.

PrefixBaseExample
0bBinary0b1111
0oOctal0o17
0xHexadecimal0xF
NoneDecimal by default15

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 / Bitwise

The 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.

OptionOutput
DecimalBase 10
BinaryBase 2
OctalBase 8
HexBase 16
Show all basesMultiple representations

In Integer / Bitwise mode, the result area also shows the bit pattern.

Floating-Point vs Integer Mode

CapabilityFloating-PointInteger / Bitwise
Decimal fractionsYesNo
Trigonometric functionsYesNo
LogarithmsYesNo
Fixed-width maskingNoYes
Bitwise operatorsNoYes
BigInt arithmeticNoYes
Signed/unsigned interpretationNoYes

Bit Widths

Integer mode provides four selectable widths.

WidthUnsigned RangeSigned Range
8-bit0 to 255-128 to 127
16-bit0 to 65,535-32,768 to 32,767
32-bit0 to 4,294,967,295-2,147,483,648 to 2,147,483,647
64-bit0 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: Enabled

Result:

-1

Binary:

1111 1111

Unsigned Integers

Disable Signed to interpret the same bit pattern as a nonnegative integer.

Expression: 255
Bit width: 8
Signed: Disabled

Result:

255

Fixed-Width Overflow

Integer results are masked to the selected bit width.

For example:

Mode: Integer / Bitwise
Bit width: 8
Signed: Disabled
Expression: 255+1

Result:

0

The 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: 8

Underlying bit pattern:

1111 1111

The 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 1111

Floating-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.


Did this page help you?