← All examples

Exact literal

*0.1 means "exactly this": a decimal literal marked * is a deci; a plain one is a bin, meaning bin64's answer.

exact_literal.zg
# `*0.1` means "exactly this" (owner, 2026-10-02): a decimal literal marked `*` is a deci; a plain one
# is a bin, meaning bin64's answer. Under `:=` the oracle makes it a deci64; the prover picks the width.
MAIN {
    let 'price' := *19.99;
    let 'tenth' := *0.1;
    let 'total' := 'tenth' plus *0.2;              # exactly 0.3
    let 'half': deci32 = *0.5;                  # a typed deci takes it at its width
    let 'speed' := 0.1;                         # a bin
    std::print.stored['price', " ", 'total', " ", 'half', " ", 'speed', newln];
}
Output
19.99 0.3 0.5 0.1000000000000000055511151231257827021181583404541015625