Capy-Bearer Documentation

u32

lib call

Capy

function u32(value : as string, opt : any = {}) u32

u32() parses text in the range 0 through 4294967295. Invalid, negative, or out-of-range text returns opt.fallback. The default fallback is 0.

A one-argument numeric conversion truncates floats toward zero and returns 0 for out-of-range or nonfinite inputs. Out-of-range integer literals fail compilation.

Text parsing follows the u64 rules, including whitespace trimming and decimal fractions. base must be a numeric whole value from 2 through 36. Do not include a 0x prefix for base 16. For example, u32("4294967296", fallback: 7) returns 7.

print(u32("ffffffff", base: 16), "\n")

Output

4294967295

Parameters

value : scalar value or text to convert

opt : options map with fallback and base

Return Values

An unsigned 32-bit integer, or opt.fallback.