io-ts-numbers

io-ts library for numbers

Usage no npm install needed!

<script type="module">
  import ioTsNumbers from 'https://cdn.skypack.dev/io-ts-numbers';
</script>

README

io-ts-numbers

License NPM Package

io-ts library for numbers

Install

npm install io-ts-numbers

Definitions

numbers

open circle = exclusive, closed circle = inclusive

This diagram denotes the sets of numbers included in some of the codecs. Note that zero is neither positive nor negative.

Here we can see that the set of Positive numbers contains all reals greater than zero. The set of NonPositive numbers contains the remaining reals (including zero). The union of the set of Positive and NonPositive numbers contains all real numbers.

This relationship is mirrored in the Negative and NonNegative sets, and the Zero and NonZero sets.

The Natural numbers are defined by the Peano axioms, so the set of Natural numbers includes zero and every finite positive integer.

Related

Acknowledgments