Skip to content

Latest commit

 

History

History

max-nth-double-factorial

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

FLOAT64_MAX_NTH_DOUBLE_FACTORIAL

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

Usage

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

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

Examples

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 );
    }
}

C APIs

Usage

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

STDLIB_CONSTANT_FLOAT64_MAX_NTH_DOUBLE_FACTORIAL

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