FLOAT64_MAX_SAFE_NTH_DOUBLE_FACTORIAL

Maximum safe nth double factorial when stored in double-precision floating-point format.

Usage

var FLOAT64_MAX_SAFE_NTH_DOUBLE_FACTORIAL = require( '@stdlib/constants/float64/max-safe-nth-double-factorial' );

FLOAT64_MAX_SAFE_NTH_DOUBLE_FACTORIAL

The maximum safe nth double factorial when stored in double-precision floating-point format.

var bool = ( FLOAT64_MAX_SAFE_NTH_DOUBLE_FACTORIAL === 301 );
// returns true

Examples

var FLOAT64_MAX_SAFE_NTH_DOUBLE_FACTORIAL = require( '@stdlib/constants/float64/max-safe-nth-double-factorial' );

function factorial( 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 = factorial( i );
    if ( i > FLOAT64_MAX_SAFE_NTH_DOUBLE_FACTORIAL ) {
        console.log( 'Unsafe: %d', v );
    } else {
        console.log( 'Safe:   %d', v );
    }
}

C APIs

Usage

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

STDLIB_CONSTANT_FLOAT64_MAX_SAFE_NTH_DOUBLE_FACTORIAL

Macro for the maximum safe nth double factorial when stored in double-precision floating-point format.

Did you find this page helpful?