Skip to content

Modern Math TryParseULong

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › Math Library › Math Library › TryParseULong

TryParseULong

Parses a whole string as a ULong, returning an empty Optional if invalid or too big.

Syntax

TryParseULong( s )

Examples

#import "std/numeric"
using numeric

var r = TryParseULong( "4294967295" )
print r.HasValue( )          '' true
print r.Value( )             '' 4294967295

'' UNSIGNED, so a negative is rejected rather than wrapping to a huge
'' positive -- which is exactly the bug VAL would hand you
print TryParseULong( "-1" ).HasValue( )       '' false

Library: Math Library
Category: Math Library
Documented under: Nothing Becomes A Keyword

Clone this wiki locally