Skip to main content
Home

Built and signed on GitHub Actions

Works with
This package works with Node.js, DenoIt is unknown whether this package works with Cloudflare Workers, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score100%
Downloads10/wk
Published3 months ago (2.0.0)

A collection for common number functions (queries, comparisons, rounding, divisors, etc.).

function classify
classify(x: number): FloatClass

Classify a number into its floating point category.

Examples

Example 1

xnumber.classify(0);
// → FloatClass.ZERO

xnumber.classify(1e-320);
// → FloatClass.SUBNORMAL

xnumber.classify(3.14);
// → FloatClass.NORMAL

xnumber.classify(Infinity);
// → FloatClass.INFINITE

xnumber.classify(NaN);
// → FloatClass.NAN

Parameters

a number

Return Type

floating point class of x

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@nodef/extra-number

Import symbol

import { classify } from "@nodef/extra-number";
or

Import directly with a jsr specifier

import { classify } from "jsr:@nodef/extra-number";