0.2.1 • Published 3 months ago

@stdlib/constants-float64-max-safe-integer v0.2.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 months ago

FLOAT64_MAX_SAFE_INTEGER

NPM version Build Status Coverage Status

Maximum safe double-precision floating-point integer.

Installation

npm install @stdlib/constants-float64-max-safe-integer

Usage

var FLOAT64_MAX_SAFE_INTEGER = require( '@stdlib/constants-float64-max-safe-integer' );

FLOAT64_MAX_SAFE_INTEGER

The maximum safe double-precision floating-point integer.

var bool = ( FLOAT64_MAX_SAFE_INTEGER === 9007199254740991 );
// returns true

Examples

var randu = require( '@stdlib/random-base-randu' );
var round = require( '@stdlib/math-base-special-round' );
var pow = require( '@stdlib/math-base-special-pow' );
var FLOAT64_MAX_SAFE_INTEGER = require( '@stdlib/constants-float64-max-safe-integer' );

var max;
var x;
var i;

max = pow( 2.0, 55 );
for ( i = 0; i < 100; i++ ) {
    x = round( randu() * max );
    if ( x > FLOAT64_MAX_SAFE_INTEGER ) {
        console.log( 'Unsafe: %d', x );
    } else {
        console.log( 'Safe: %d', x );
    }
}

C APIs

Usage

#include "stdlib/constants/float64/max_safe_integer.h"

STDLIB_CONSTANT_FLOAT64_MAX_SAFE_INTEGER

Macro for the maximum safe double-precision floating-point integer.


See Also


Notice

This package is part of 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, see the main project repository.

Community

Chat


License

See LICENSE.

Copyright

Copyright © 2016-2024. The Stdlib Authors.

@infinitebrahmanuniverse/nolb-_stdlib_c@everything-registry/sub-chunk-867@stdlib/utils-inherited-enumerable-properties@stdlib/utils-inherited-enumerable-property-symbols@stdlib/utils-inherited-keys@stdlib/utils-inherited-nonenumerable-properties@stdlib/utils-inherited-nonenumerable-property-names@stdlib/utils-inherited-nonenumerable-property-symbols@stdlib/utils-inherited-properties@stdlib/utils-inherited-property-descriptor@stdlib/utils-inherited-property-descriptors@stdlib/utils-inherited-property-names@stdlib/utils-inherited-property-symbols@stdlib/utils-inherited-writable-properties@stdlib/utils-inherited-writable-property-names@stdlib/utils-inherited-writable-property-symbols@stdlib/utils-safe-int-max@stdlib/math-base-special-cospi@stdlib/math-base-special-binomcoef@stdlib/math-base-special-ceiln@stdlib/math-base-special-roundn@stdlib/math-base-special-floorn@stdlib/math-base-special-truncn@stdlib/math-iter-sequences-even-integers@stdlib/math-iter-sequences-integers@stdlib/math-iter-sequences-negative-odd-integers@stdlib/math-iter-sequences-nonnegative-even-integers@stdlib/math-iter-sequences-nonnegative-integers@stdlib/math-iter-sequences-nonpositive-even-integers@stdlib/math-iter-sequences-nonpositive-integers@stdlib/math-iter-sequences-odd-integers@stdlib/math-iter-sequences-positive-even-integers@stdlib/math-iter-sequences-positive-integers@stdlib/math-iter-sequences-positive-odd-integers@stdlib/math-iter-sequences-negative-even-integers@stdlib/math-iter-sequences-negative-integers@stdlib/math-base-assert-is-prime@stdlib/math-base-assert-is-safe-integer@stdlib/string-right-pad@stdlib/string-left-pad@stdlib/string-pad@stdlib/constants-float64@stdlib/random-base-mt19937@stdlib/random-base-discrete-uniform@zalastax/nolb-_stdlib_c
0.2.1

3 months ago

0.2.0

3 months ago

0.1.0

8 months ago

0.1.1

7 months ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago