Expand description

Public API for the number format packed struct.

This has a consistent API whether or not the format feature is enabled, however, most functionality will be disabled if the feature is not enabled.

Pre-Defined Formats

These are the pre-defined formats for parsing numbers from various programming, markup, and data languages.

Syntax Flags

Bitflags to get and set syntax flags for the format packed struct.

Digit Separator Flags

Bitflags to get and set digit separators flags for the format packed struct.

Character Shifts and Masks

Bitmasks and bitshifts to get and set control characters for the format packed struct.

Character Functions

Functions to get control characters from the format packed struct.

Validators

Functions to validate control characters for the format packed struct.

Structs

Build number format from specifications.

Constants

Mask to extract the base prefix character.

Shift to convert to and from a base prefix as a u8.

Mask to extract the base suffix character.

Shift to convert to and from a base suffix as a u8.

Number format for a C++98 literal hexadecimal floating-point number.

Number format for a C11 string hexadecimal floating-point number.

Number format for a C++98 literal floating-point number.

Number format for a C++98 string floating-point number.

Number format for a C++98 literal hexadecimal floating-point number.

Number format for a C18 string hexadecimal floating-point number.

Number format for a C++98 literal floating-point number.

Number format for a C++98 string floating-point number.

Number format for a C89 string hexadecimal floating-point number.

Number format for a C++98 literal floating-point number.

Number format for a C++98 string floating-point number.

Number format for a C90 string hexadecimal floating-point number.

Number format for a C++98 literal floating-point number.

Number format for a C++98 string floating-point number.

Number format for a C++98 literal hexadecimal floating-point number.

Number format for a C99 string hexadecimal floating-point number.

Number format for a C++98 literal floating-point number.

Number format for a C++98 string floating-point number.

Base prefixes are case-sensitive.

Base suffixes are case-sensitive.

Exponent characters are case-sensitive.

Special (non-finite) values are case-sensitive.

Number format for a Clojure literal floating-point number.

Number format to parse a Clojure float from string.

Number format for a Cobol literal floating-point number.

Number format to parse a Cobol float from string.

Number format for a Coffeescript literal floating-point number.

Number format to parse a Coffeescript float from string.

Multiple consecutive digit separators are allowed.

Number format for a C#1 literal floating-point number.

Number format to parse a C#1 float from string.

Number format for a C#2 literal floating-point number.

Number format to parse a C#2 float from string.

Number format for a C#3 literal floating-point number.

Number format to parse a C#3 float from string.

Number format for a C#4 literal floating-point number.

Number format to parse a C#4 float from string.

Number format for a C#5 literal floating-point number.

Number format to parse a C#5 float from string.

Number format for a C#6 literal floating-point number.

Number format to parse a C#6 float from string.

Number format for a C#7 literal floating-point number.

Number format to parse a C#7 float from string.

Number format for a C# literal floating-point number.

Number format to parse a C# float from string.

Number format for a C++03 literal floating-point number.

Number format for a C++03 string floating-point number.

Number format for a C++11 string hexadecimal floating-point number.

Number format for a C++11 literal floating-point number.

Number format for a C++11 string floating-point number.

Number format for a C++14 string hexadecimal floating-point number.

Number format for a C++14 literal floating-point number.

Number format for a C++14 string floating-point number.

Number format for a C++17 literal hexadecimal floating-point number.

Number format for a C++17 string hexadecimal floating-point number.

Number format for a C++17 literal floating-point number.

Number format for a C++17 string floating-point number.

Number format for a C++20 literal hexadecimal floating-point number.

Number format for a C++20 string hexadecimal floating-point number.

Number format for a C++20 literal floating-point number.

Number format for a C++20 string floating-point number.

Number format for a C++98 literal floating-point number.

Number format for a C++98 string floating-point number.

Number format for a C++ literal hexadecimal floating-point number.

Number format to parse a C++ hexadecimal float from string.

Number format for a C++ literal floating-point number.

Number format to parse a C++ float from string.

Number format for a C literal hexadecimal floating-point number.

Number format to parse a C hexadecimal float from string.

Number format for a C literal floating-point number.

Number format to parse a C float from string.

Mask to extract the digit separator character.

Shift to convert to and from a digit separator as a u8.

Number format for a D literal floating-point number.

Number format to parse a D float from string.

Number format for an Elixir literal floating-point number.

Number format to parse an Elixir float from string.

Number format for an Elm literal floating-point number.

Number format to parse an Elm float from string.

Number format for an Erlang literal floating-point number.

Number format to parse an Erlang float from string.

Mask to extract the exponent base: the base the exponent is raised to.

Shift to convert to and from an exponent base as a u32.

Multiple consecutive exponent digit separators are allowed.

Digit separators are allowed between exponent digits.

A digit separator is allowed before any exponent digits.

Mask to extract the exponent radix: the radix for the exponent digits.

Shift to convert to and from an exponent radix as a u32.

A digit separator is allowed after any exponent digits.

Number format for a FORTRAN literal floating-point number.

Number format to parse a FORTRAN float from string.

Multiple consecutive fraction digit separators are allowed.

Digit separators are allowed between fraction digits.

A digit separator is allowed before any fraction digits.

A digit separator is allowed after any fraction digits.

Number format for a F# literal floating-point number.

Number format to parse a F# float from string.

Number format for a Gambit-C literal floating-point number.

Number format to parse a Gambit-C float from string.

Number format for a Golang literal floating-point number.

Number format to parse a Golang float from string.

Number format for a Guile literal floating-point number.

Number format to parse a Guile float from string.

Number format for a Haskell literal floating-point number.

Number format to parse a Haskell float from string.

Multiple consecutive integer digit separators are allowed.

Digit separators are allowed between integer digits.

A digit separator is allowed before any integer digits.

A digit separator is allowed after any integer digits.

Digit separators are allowed between digits.

Number format for a Javascript literal floating-point number.

Number format to parse a Javascript float from string.

Number format for a Java literal floating-point number.

Number format to parse a Java float from string.

Number format for a JSON literal floating-point number.

Number format for a Julia literal floating-point number.

Number format to parse a Julia float from string.

Number format for a Julia literal floating-point number.

Number format to parse a Julia float from string.

Number format for a Kawa literal floating-point number.

Number format to parse a Kawa float from string.

Number format for a Kotlin literal floating-point number.

Number format to parse a Kotlin float from string.

A digit separator is allowed before any digits.

Mask to extract the mantissa radix: the radix for the significant digits.

Shift to convert to and from a mantissa radix as a u32.

Number format for an Matlab literal floating-point number.

Number format to parse an Matlab float from string.

Number format for a MongoDB literal floating-point number.

Number format for a MySQL literal floating-point number.

Exponent notation is not allowed.

Exponent without a fraction component is not allowed.

Leading zeros before a float value are not allowed.

Leading zeros before an integer value are not allowed.

Positive sign before the exponent is not allowed.

Positive sign before the mantissa is not allowed.

Special (non-finite) values are not allowed.

Number format for an Objective-C literal floating-point number.

Number format to parse an Objective-C float from string.

Number format for an OCaml literal floating-point number.

Number format to parse an OCaml float from string.

Number format for an Octave literal floating-point number.

Number format to parse an Octave float from string.

Number format for a Perl literal floating-point number.

Number format to parse a Perl float from string.

Number format for a PHP literal floating-point number.

Number format to parse a PHP float from string.

Number format for a PostgreSQL literal floating-point number.

Number format for a Python2 literal floating-point number.

Number format to parse a Python2 float from string.

Number format for a Python3 literal floating-point number.

Number format to parse a Python3 float from string.

Number format for a Python3.5 or lower literal floating-point number.

Number format for a Python3.6 or higher literal floating-point number.

Number format for a Python literal floating-point number.

Number format to parse a Python float from string.

Alias for MANTISSA_RADIX.

Alias for MANTISSA_RADIX_SHIFT.

Number format for a ReasonML literal floating-point number.

Number format to parse a ReasonML float from string.

At least 1 digit in the number is required.

Digits are required after the exponent character. This check will only occur if the exponent character is present.

Exponent notation is required.

Positive sign before the exponent is required.

Digits are required after the decimal point. This check will only occur if the decimal point is present.

Digits are required before the decimal point.

Mantissa digits are required (either before or after the decimal point).

Positive sign before the mantissa is required.

Number format for a Ruby literal floating-point number.

Number format for a Ruby literal floating-point number.

Number format to parse a Ruby float from string.

Number format for a Rust literal floating-point number.

Number format to parse a Rust float from string.

Number format for a R literal floating-point number.

Number format to parse a R float from string.

Number format for a Sage literal floating-point number.

Number format to parse a Sage float from string.

Number format for a Scala literal floating-point number.

Number format to parse a Scala float from string.

Any digit separators are allowed in special (non-finite) values.

Number format for a SQLite literal floating-point number.

Standard number format. This is identical to the Rust string format.

Number format for a Swift literal floating-point number.

Number format to parse a Swift float from string.

Number format for a TOML literal floating-point number.

A digit separator is allowed after any digits.

Number format for a Visual Basic literal floating-point number.

Number format to parse a Visual Basic float from string.

Number format for a XML literal floating-point number.

Number format for a YAML literal floating-point number.

Number format for a Zig literal floating-point number.

Number format to parse a Zig float from string.

Functions

Extract the base prefix character from the format packed struct.

Extract the base suffix character from the format packed struct.

Extract the digit separator from the format packed struct.

Extract the exponent base from the format packed struct. If not provided, defaults to mantissa_radix.

Extract the exponent radix from the format packed struct. If not provided, defaults to mantissa_radix.

Get the error type from the format packed struct.

Determine if the format packed struct is valid.

Determine if the base prefix character is valid.

Determine if the base suffix character is valid.

Determine if the digit separator is valid. Digit separators must not be valid digits or sign characters.

Determine if the provided exponent flags are valid.

Determine if all of the “punctuation” characters for the options API are valid.

Determine if all of the “punctuation” characters are valid.

Determine if the radix is valid.

Extract the mantissa radix from the format packed struct.

Extract a generic radix from the format and bitflags.

Type Definitions

Type with the exact same size as a u8.