Numbers
Nubo supports integer and floating-point numbers, including prefixed number literals.
Integer Literals
Section titled “Integer Literals”let dec = 1000println(dec)Floating-Point Literals
Section titled “Floating-Point Literals”let flo = 1000.5println(flo)Binary, Octal, and Hexadecimal
Section titled “Binary, Octal, and Hexadecimal”Use numeric prefixes for different bases:
let bin = 0b1010let oct = 0o123let hex = 0x1A
println(bin)println(oct)println(hex)Numeric Separators
Section titled “Numeric Separators”Use _ to make large numbers easier to read:
for i in 100_00 { println(i)}Arithmetic
Section titled “Arithmetic”Use standard arithmetic operators:
let sum = 0sum = sum + 10
println(sum)You can also combine arithmetic with function results:
import time from "@std/time"
const start = time.now()const end = time.now()
println("Finished in", (end - start) / 1_000_000_000, "seconds")