Module

Neon.Primitive.Number

Package
purescript-neon
Repository
tfausak/purescript-neon

#aNumber Source

aNumber :: Number -> Boolean

Tests if a number is a valid number. Returns false if the number is nan. This is necessary because nan does not equal itself.

aNumber 1.0 -- true
aNumber nan -- false
nan == nan -- false

#ceiling Source

ceiling :: Number -> Int

Rounds a number up.

ceiling 1.1 -- 2

#finite Source

finite :: Number -> Boolean

Tests whether a number is finite or not.

finite 1.0 -- true
finite infinity -- false

#floor Source

floor :: Number -> Int

Rounds a number down.

floor 1.9 -- 1

#infinity Source

infinity :: Number

An alias for Infinity from JavaScript.

#nan Source

nan :: Number

An alias for NaN from JavaScript.

#round Source

round :: Number -> Int

Rounds a number to the nearest integer.

round 1.4 -- 1
round 1.6 -- 2
round 1.5 -- 2
round 2.5 -- 3