Official website

Quick search

Search pages in English or हिंदी. Detailed language reference is in Scarp Docs.

Top 6 website pages

Language prerelease · Published source

Scarp alpha.11: exact decimal arithmetic

Scarp alpha.11 introduces an experimental exact decimal type with explicit conversion, rounding and interactive input.

v0.0.6-alpha.11 was published on 15 November 2026. Its experimental decimal type represents exact base-10 values without silently converting them into floating-point numbers.

Explicit arithmetic and rounding

Use decimal("199.99") to parse decimal text. Arithmetic preserves the exact type; conversions from or to integers are explicit. decimal_round changes a value,decimal_format produces text, anddecimal_div_rounded takes a requested scale and rounding mode.

pricing.srp
bind price: decimal = decimal("199.99");
bind tax = decimal("0.18");
print(decimal_format(price + price * tax, 2, "half_even"));
Expected stdout
235.99

Interactive programs can use input_decimal(prompt)with scarp exec --interactive; scripted programs can supply --input-file or parse a redirected line.

Known limits in this prerelease

Decimal values are limited to 28 canonical coefficient digits and 18 fractional places. Text parsing rejects exponents and digit separators; inexact division needs explicit rounding. Decimal execution is interpreter-only, and the experimental native emitters reject it. This version is not a stable API.

See the published alpha.11 notes and exact release source. The newer alpha.12 overviewexplains subsequent aggregate-type features.