Error codes

E0283: a hex, octal or binary format on a non-int

In a terminal: auk explain E0283 prints this page.

On this page

The format types x (hex), X (hex in capitals), o (octal) and b (binary) show an int in that base: "{n:x}", "{n:08b}". A negative int shows its 64-bit two's complement. They don't apply to other types.

Wrong#

auk
fn show(x: float): str = "{x:x}"

Fixed#

auk
fn show(x: float): str = "{int(x):x}"

Common causes#

  • A float or char formatted as hex: convert with int(x) (a char's code point is int(c)).
  • A float's bits: "{x.bits():016x}".

Stuck on a word? Try the glossary. Got a compiler error? Look up its code. Improve this page