Maximum nth double factorial when stored in double-precision floating-point format.
var FLOAT64_MAX_NTH_DOUBLE_FACTORIAL = require( '@stdlib/constants/float64/max-nth-double-factorial' );
The maximum nth double factorial when stored in double-precision floating-point format.
var bool = ( FLOAT64_MAX_NTH_DOUBLE_FACTORIAL === 300 );
// returns true
var FLOAT64_MAX_NTH_DOUBLE_FACTORIAL = require( '@stdlib/constants/float64/max-nth-double-factorial' );
function factorial2( n ) {
var a;
var i;
a = 1;
for ( i = n; i >= 2; i -= 2 ) {
a *= i;
}
return a;
}
var v;
var i;
for ( i = 0; i < 400; i++ ) {
v = factorial2( i );
if ( i > FLOAT64_MAX_NTH_DOUBLE_FACTORIAL ) {
console.log( 'Overflow: %d', v );
} else {
console.log( 'Valid: %d', v );
}
}
#include "stdlib/constants/float64/max_nth_double_factorial.h"
Macro for the maximum nth double factorial when stored in double-precision floating-point format.