Science & Data

Number systems

Hissab supports decimal, binary, octal, and hexadecimal literals.

Prefixes

BasePrefixExample
Decimalnone1234
Binary0b0b10011010
Octal0o0o12341
Hexadecimal0x0x12ab2e4
1234
0b10011010 to decimal
0o12341 to decimal
0x12ab2e4 to decimal

Conversion

Targets are binary, octal, decimal, and hex.

0xff to binary
0o755 to hex
255 to octal

Use hex, not hexadecimal, as the conversion target.

Arithmetic across bases

You can mix bases freely and convert the final result.

0b10011010 + 0x1a to decimal
0xff & 0x0f to decimal

Notes

  • If you do not append to <base>, output formatting follows the left operand's base.
  • Negative numbers in non-decimal bases are not supported as literals. Compute with positive literals and negate the result separately if needed.

Common mistakes

  • 255 to hexadecimal is invalid — use 255 to hex.
  • Digits must fit the base — binary uses 01, octal uses 07, and hex uses 09 plus af.
255 to hex