Skip to main content

Numbers

Numbers in Kexra represent numeric values, supporting basic arithmetic operations.

Why this exists

Numbers enable mathematical computations and quantitative data handling in programs.

How it works

Numbers are floating-point values. All numeric literals are treated as numbers.

Examples

set x = 42
set y = 3.14
say x + y # 45.14

Common mistakes

  • Assuming integer division (all division is floating-point)
  • Not handling floating-point precision issues