https://github.com/stdlib-js/constants-float32
Single-precision floating-point mathematical constants.
https://github.com/stdlib-js/constants-float32
const constants float float32 floating-point ieee754 javascript lib library math mathematics namespace node node-js nodejs single single-precision standard stdlib
Last synced: 4 months ago
JSON representation
Single-precision floating-point mathematical constants.
- Host: GitHub
- URL: https://github.com/stdlib-js/constants-float32
- Owner: stdlib-js
- License: apache-2.0
- Created: 2021-06-15T18:08:01.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-08-20T03:54:17.000Z (6 months ago)
- Last Synced: 2025-09-05T05:55:01.642Z (5 months ago)
- Topics: const, constants, float, float32, floating-point, ieee754, javascript, lib, library, math, mathematics, namespace, node, node-js, nodejs, single, single-precision, standard, stdlib
- Language: JavaScript
- Homepage: https://github.com/stdlib-js/stdlib
- Size: 923 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Citation: CITATION.cff
- Security: SECURITY.md
Awesome Lists containing this project
README
About stdlib...
We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.
The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.
When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.
To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!
# Constants
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url]
> Single-precision floating-point mathematical constants.
## Installation
```bash
npm install @stdlib/constants-float32
```
Alternatively,
- To load the package in a website via a `script` tag without installation and bundlers, use the [ES Module][es-module] available on the [`esm`][esm-url] branch (see [README][esm-readme]).
- If you are using Deno, visit the [`deno`][deno-url] branch (see [README][deno-readme] for usage intructions).
- For use in Observable, or in browser/node environments, use the [Universal Module Definition (UMD)][umd] build available on the [`umd`][umd-url] branch (see [README][umd-readme]).
The [branches.md][branches-url] file summarizes the available branches and displays a diagram illustrating their relationships.
To view installation and usage instructions specific to each branch build, be sure to explicitly navigate to the respective README files on each branch, as linked to above.
## Usage
```javascript
var constants = require( '@stdlib/constants-float32' );
```
#### constants
Single-precision floating-point mathematical constants.
```javascript
var c = constants;
// returns {...}
```
- [`ABS_MASK`][@stdlib/constants/float32/abs-mask]: mask for excluding the sign bit of a single-precision floating-point number.
- [`CBRT_EPS`][@stdlib/constants/float32/cbrt-eps]: cube root of single-precision floating-point epsilon.
- [`E`][@stdlib/constants/float32/e]: the mathematical constant _e_.
- [`EPS`][@stdlib/constants/float32/eps]: difference between one and the smallest value greater than one that can be represented as a single-precision floating-point number.
- [`EXPONENT_BIAS`][@stdlib/constants/float32/exponent-bias]: the bias of a single-precision floating-point number's exponent.
- [`EXPONENT_MASK`][@stdlib/constants/float32/exponent-mask]: mask for the exponent of a single-precision floating-point number.
- [`FOURTH_PI`][@stdlib/constants/float32/fourth-pi]: one fourth times the mathematical constant π.
- [`HALF_LN_TWO`][@stdlib/constants/float32/half-ln-two]: one half times the natural logarithm of `2` as a single-precision floating-point number.
- [`HALF_PI`][@stdlib/constants/float32/half-pi]: one half times the mathematical constant π.
- [`LN_HALF`][@stdlib/constants/float32/ln-half]: natural logarithm of `1/2` as a single-precision floating-point number.
- [`LN_PI`][@stdlib/constants/float32/ln-pi]: natural logarithm of the mathematical constant π as a single-precision floating-point number.
- [`LN_TEN`][@stdlib/constants/float32/ln-ten]: natural logarithm of `10` as a single-precision floating-point number.
- [`LN_TWO`][@stdlib/constants/float32/ln-two]: natural logarithm of `2` as a single-precision floating-point number.
- [`MAX_BASE10_EXPONENT_SUBNORMAL`][@stdlib/constants/float32/max-base10-exponent-subnormal]: the maximum base 10 exponent for a subnormal single-precision floating-point number.
- [`MAX_BASE10_EXPONENT`][@stdlib/constants/float32/max-base10-exponent]: the maximum base 10 exponent for a single-precision floating-point number.
- [`MAX_BASE2_EXPONENT_SUBNORMAL`][@stdlib/constants/float32/max-base2-exponent-subnormal]: the maximum biased base 2 exponent for a subnormal single-precision floating-point number.
- [`MAX_BASE2_EXPONENT`][@stdlib/constants/float32/max-base2-exponent]: the maximum biased base 2 exponent for a single-precision floating-point number.
- [`MAX_SAFE_FIBONACCI`][@stdlib/constants/float32/max-safe-fibonacci]: maximum safe Fibonacci number when stored in single-precision floating-point format.
- [`MAX_SAFE_INTEGER`][@stdlib/constants/float32/max-safe-integer]: maximum safe single-precision floating-point integer.
- [`MAX_SAFE_NTH_FACTORIAL`][@stdlib/constants/float32/max-safe-nth-factorial]: maximum safe nth factorial when stored in single-precision floating-point format.
- [`MAX_SAFE_NTH_FIBONACCI`][@stdlib/constants/float32/max-safe-nth-fibonacci]: maximum safe nth Fibonacci number when stored in single-precision floating-point format.
- [`MAX_SAFE_NTH_LUCAS`][@stdlib/constants/float32/max-safe-nth-lucas]: maximum safe nth Lucas number when stored in single-precision floating-point format.
- [`MAX`][@stdlib/constants/float32/max]: maximum single-precision floating-point number.
- [`MIN_BASE10_EXPONENT_SUBNORMAL`][@stdlib/constants/float32/min-base10-exponent-subnormal]: the minimum base 10 exponent for a subnormal single-precision floating-point number.
- [`MIN_BASE10_EXPONENT`][@stdlib/constants/float32/min-base10-exponent]: the minimum base 10 exponent for a normal single-precision floating-point number.
- [`MIN_BASE2_EXPONENT_SUBNORMAL`][@stdlib/constants/float32/min-base2-exponent-subnormal]: the minimum biased base 2 exponent for a subnormal single-precision floating-point number.
- [`MIN_BASE2_EXPONENT`][@stdlib/constants/float32/min-base2-exponent]: the minimum biased base 2 exponent for a normal single-precision floating-point number.
- [`MIN_SAFE_INTEGER`][@stdlib/constants/float32/min-safe-integer]: minimum safe single-precision floating-point integer.
- [`NAN`][@stdlib/constants/float32/nan]: single-precision floating-point `NaN`.
- [`NINF`][@stdlib/constants/float32/ninf]: single-precision floating-point negative infinity.
- [`NUM_BYTES`][@stdlib/constants/float32/num-bytes]: size (in bytes) of a single-precision floating-point number.
- [`PHI`][@stdlib/constants/float32/phi]: golden ratio.
- [`PI`][@stdlib/constants/float32/pi]: the mathematical constant π.
- [`PINF`][@stdlib/constants/float32/pinf]: single-precision floating-point positive infinity.
- [`PRECISION`][@stdlib/constants/float32/precision]: effective number of bits in the significand of a single-precision floating-point number.
- [`SIGN_MASK`][@stdlib/constants/float32/sign-mask]: mask for the sign bit of a single-precision floating-point number.
- [`SIGNIFICAND_MASK`][@stdlib/constants/float32/significand-mask]: mask for the significand of a single-precision floating-point number.
- [`SMALLEST_NORMAL`][@stdlib/constants/float32/smallest-normal]: smallest positive **normalized** single-precision floating-point number.
- [`SMALLEST_SUBNORMAL`][@stdlib/constants/float32/smallest-subnormal]: smallest positive **denormalized** single-precision floating-point number.
- [`SQRT_EPS`][@stdlib/constants/float32/sqrt-eps]: square root of single-precision floating-point epsilon.
- [`SQRT_HALF_PI`][@stdlib/constants/float32/sqrt-half-pi]: square root of the mathematical constant π divided by 2 as a single-precision floating-point number.
- [`SQRT_HALF`][@stdlib/constants/float32/sqrt-half]: square root of `1/2` as a single-precision floating-point number.
- [`SQRT_PHI`][@stdlib/constants/float32/sqrt-phi]: square root of the Golden ratio (φ) as a single-precision floating-point number.
- [`SQRT_PI`][@stdlib/constants/float32/sqrt-pi]: square root of the mathematical constant π as a single-precision floating-point number.
- [`SQRT_THREE`][@stdlib/constants/float32/sqrt-three]: square root of `3` as a single-precision floating-point number.
- [`SQRT_TWO_PI`][@stdlib/constants/float32/sqrt-two-pi]: square root of the mathematical constant π times 2 as a single-precision floating-point number.
- [`SQRT_TWO`][@stdlib/constants/float32/sqrt-two]: square root of `2` as a single-precision floating-point number.
- [`TWO_PI`][@stdlib/constants/float32/two-pi]: the mathematical constant π times 2.
## Examples
```javascript
var objectKeys = require( '@stdlib/utils-keys' );
var constants = require( '@stdlib/constants-float32' );
console.log( objectKeys( constants ) );
```
* * *
## Notice
This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib].
#### Community
[![Chat][chat-image]][chat-url]
---
## License
See [LICENSE][stdlib-license].
## Copyright
Copyright © 2016-2025. The Stdlib [Authors][stdlib-authors].
[npm-image]: http://img.shields.io/npm/v/@stdlib/constants-float32.svg
[npm-url]: https://npmjs.org/package/@stdlib/constants-float32
[test-image]: https://github.com/stdlib-js/constants-float32/actions/workflows/test.yml/badge.svg?branch=main
[test-url]: https://github.com/stdlib-js/constants-float32/actions/workflows/test.yml?query=branch:main
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/constants-float32/main.svg
[coverage-url]: https://codecov.io/github/stdlib-js/constants-float32?branch=main
[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
[chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
[stdlib]: https://github.com/stdlib-js/stdlib
[stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
[umd]: https://github.com/umdjs/umd
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
[deno-url]: https://github.com/stdlib-js/constants-float32/tree/deno
[deno-readme]: https://github.com/stdlib-js/constants-float32/blob/deno/README.md
[umd-url]: https://github.com/stdlib-js/constants-float32/tree/umd
[umd-readme]: https://github.com/stdlib-js/constants-float32/blob/umd/README.md
[esm-url]: https://github.com/stdlib-js/constants-float32/tree/esm
[esm-readme]: https://github.com/stdlib-js/constants-float32/blob/esm/README.md
[branches-url]: https://github.com/stdlib-js/constants-float32/blob/main/branches.md
[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/constants-float32/main/LICENSE
[@stdlib/constants/float32/abs-mask]: https://github.com/stdlib-js/constants-float32-abs-mask
[@stdlib/constants/float32/cbrt-eps]: https://github.com/stdlib-js/constants-float32-cbrt-eps
[@stdlib/constants/float32/e]: https://github.com/stdlib-js/constants-float32-e
[@stdlib/constants/float32/eps]: https://github.com/stdlib-js/constants-float32-eps
[@stdlib/constants/float32/exponent-bias]: https://github.com/stdlib-js/constants-float32-exponent-bias
[@stdlib/constants/float32/exponent-mask]: https://github.com/stdlib-js/constants-float32-exponent-mask
[@stdlib/constants/float32/fourth-pi]: https://github.com/stdlib-js/constants-float32-fourth-pi
[@stdlib/constants/float32/half-ln-two]: https://github.com/stdlib-js/constants-float32-half-ln-two
[@stdlib/constants/float32/half-pi]: https://github.com/stdlib-js/constants-float32-half-pi
[@stdlib/constants/float32/ln-half]: https://github.com/stdlib-js/constants-float32-ln-half
[@stdlib/constants/float32/ln-pi]: https://github.com/stdlib-js/constants-float32-ln-pi
[@stdlib/constants/float32/ln-ten]: https://github.com/stdlib-js/constants-float32-ln-ten
[@stdlib/constants/float32/ln-two]: https://github.com/stdlib-js/constants-float32-ln-two
[@stdlib/constants/float32/max-base10-exponent-subnormal]: https://github.com/stdlib-js/constants-float32-max-base10-exponent-subnormal
[@stdlib/constants/float32/max-base10-exponent]: https://github.com/stdlib-js/constants-float32-max-base10-exponent
[@stdlib/constants/float32/max-base2-exponent-subnormal]: https://github.com/stdlib-js/constants-float32-max-base2-exponent-subnormal
[@stdlib/constants/float32/max-base2-exponent]: https://github.com/stdlib-js/constants-float32-max-base2-exponent
[@stdlib/constants/float32/max-safe-fibonacci]: https://github.com/stdlib-js/constants-float32-max-safe-fibonacci
[@stdlib/constants/float32/max-safe-integer]: https://github.com/stdlib-js/constants-float32-max-safe-integer
[@stdlib/constants/float32/max-safe-nth-factorial]: https://github.com/stdlib-js/constants-float32-max-safe-nth-factorial
[@stdlib/constants/float32/max-safe-nth-fibonacci]: https://github.com/stdlib-js/constants-float32-max-safe-nth-fibonacci
[@stdlib/constants/float32/max-safe-nth-lucas]: https://github.com/stdlib-js/constants-float32-max-safe-nth-lucas
[@stdlib/constants/float32/max]: https://github.com/stdlib-js/constants-float32-max
[@stdlib/constants/float32/min-base10-exponent-subnormal]: https://github.com/stdlib-js/constants-float32-min-base10-exponent-subnormal
[@stdlib/constants/float32/min-base10-exponent]: https://github.com/stdlib-js/constants-float32-min-base10-exponent
[@stdlib/constants/float32/min-base2-exponent-subnormal]: https://github.com/stdlib-js/constants-float32-min-base2-exponent-subnormal
[@stdlib/constants/float32/min-base2-exponent]: https://github.com/stdlib-js/constants-float32-min-base2-exponent
[@stdlib/constants/float32/min-safe-integer]: https://github.com/stdlib-js/constants-float32-min-safe-integer
[@stdlib/constants/float32/nan]: https://github.com/stdlib-js/constants-float32-nan
[@stdlib/constants/float32/ninf]: https://github.com/stdlib-js/constants-float32-ninf
[@stdlib/constants/float32/num-bytes]: https://github.com/stdlib-js/constants-float32-num-bytes
[@stdlib/constants/float32/phi]: https://github.com/stdlib-js/constants-float32-phi
[@stdlib/constants/float32/pi]: https://github.com/stdlib-js/constants-float32-pi
[@stdlib/constants/float32/pinf]: https://github.com/stdlib-js/constants-float32-pinf
[@stdlib/constants/float32/precision]: https://github.com/stdlib-js/constants-float32-precision
[@stdlib/constants/float32/sign-mask]: https://github.com/stdlib-js/constants-float32-sign-mask
[@stdlib/constants/float32/significand-mask]: https://github.com/stdlib-js/constants-float32-significand-mask
[@stdlib/constants/float32/smallest-normal]: https://github.com/stdlib-js/constants-float32-smallest-normal
[@stdlib/constants/float32/smallest-subnormal]: https://github.com/stdlib-js/constants-float32-smallest-subnormal
[@stdlib/constants/float32/sqrt-eps]: https://github.com/stdlib-js/constants-float32-sqrt-eps
[@stdlib/constants/float32/sqrt-half-pi]: https://github.com/stdlib-js/constants-float32-sqrt-half-pi
[@stdlib/constants/float32/sqrt-half]: https://github.com/stdlib-js/constants-float32-sqrt-half
[@stdlib/constants/float32/sqrt-phi]: https://github.com/stdlib-js/constants-float32-sqrt-phi
[@stdlib/constants/float32/sqrt-pi]: https://github.com/stdlib-js/constants-float32-sqrt-pi
[@stdlib/constants/float32/sqrt-three]: https://github.com/stdlib-js/constants-float32-sqrt-three
[@stdlib/constants/float32/sqrt-two-pi]: https://github.com/stdlib-js/constants-float32-sqrt-two-pi
[@stdlib/constants/float32/sqrt-two]: https://github.com/stdlib-js/constants-float32-sqrt-two
[@stdlib/constants/float32/two-pi]: https://github.com/stdlib-js/constants-float32-two-pi