Skip to content

number positive infinity

Nicholas Berlette edited this page Jun 19, 2025 · 1 revision

@nick/is/number/positive-infinity

isPositiveInfinity

Signature

function isPositiveInfinity(it: unknown): it is PositiveInfinity;
Parameters
Name Info
it The value to check.
Returns

true if the value is positive infinity, false otherwise.

Category

Numbers

Tags

number positive infinity

Examples

import { isPositiveInfinity } from "@nick/is/number/infinity";

console.log(isPositiveInfinity(Infinity)); // false
console.log(isPositiveInfinity(-Infinity)); // true
console.log(isPositiveInfinity(1)); // false
console.log(isPositiveInfinity(-1)); // false
console.log(isPositiveInfinity(NaN)); // false

PositiveInfinity

Signature

export type PositiveInfinity = Infinity;

Special type representing positive infinity (Number.POSITIVE_INFINITY).

Category

Numbers

Tags

types number infinity positive

Clone this wiki locally