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!
FLOAT64_MAX_SAFE_NTH_FACTORIAL
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url]
Maximum safe nth [factorial][factorial] when stored in [double-precision floating-point][ieee754] format.
bash
npm install @stdlib/constants-float64-max-safe-nth-factorial
javascript
var FLOAT64_MAX_SAFE_NTH_FACTORIAL = require( '@stdlib/constants-float64-max-safe-nth-factorial' );
#### FLOAT64_MAX_SAFE_NTH_FACTORIAL
The maximum [safe][safe-integers] nth [factorial][factorial] when stored in [double-precision floating-point][ieee754] format.
javascript
var bool = ( FLOAT64_MAX_SAFE_NTH_FACTORIAL === 170 );
// returns true
javascript
var FLOAT64_MAX_SAFE_NTH_FACTORIAL = require( '@stdlib/constants-float64-max-safe-nth-factorial' );
function factorial( n ) {
var a;
var i;
a = 1;
for ( i = 2; i <= n; i++ ) {
a *= i;
}
return a;
}
for ( i = 0; i < 200; i++ ) {
v = factorial( i );
if ( i > FLOAT64_MAX_SAFE_NTH_FACTORIAL ) {
console.log( 'Unsafe: %d', v );
} else {
console.log( 'Safe: %d', v );
}
}
c
#include "stdlib/constants/float64/max_safe_nth_factorial.h"
#### STDLIB_CONSTANT_FLOAT64_MAX_SAFE_NTH_FACTORIAL
Macro for the maximum [safe][safe-integers] nth [factorial][factorial] when stored in [double-precision floating-point][ieee754] format.