Skip to content

Modern Math Classify

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

Home › Math Library › Math Library › Classify

Classify

Returns whether a value is NaN, infinite, zero, subnormal or normal.

Syntax

Classify( x )

Examples

#import "std/numeric"
using numeric

'' One call instead of a chain of predicates, answering with an FpClass
print Classify( 1.0 ) = FP_NORMAL             '' -1 (true)
print Classify( 0.0 ) = FP_ZERO               '' -1 (true)
print Classify( NaN( ) ) = FP_NAN             '' -1 (true)
print Classify( Infinity( ) ) = FP_INFINITE   '' -1 (true)
print Classify( MinSubnormalDouble( ) ) = FP_SUBNORMAL    '' -1 (true)

'' The five categories are exhaustive and mutually exclusive, which a
'' sequence of Is* tests is not obviously

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

Clone this wiki locally