Skip to content

Latest commit

 

History

History
164 lines (98 loc) · 3.29 KB

File metadata and controls

164 lines (98 loc) · 3.29 KB

FLOAT16_MAX_NTH_DOUBLE_FACTORIAL

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

Usage

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

FLOAT16_MAX_NTH_DOUBLE_FACTORIAL

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

var bool = ( FLOAT16_MAX_NTH_DOUBLE_FACTORIAL === 12 );
// returns true

Examples

var FLOAT16_MAX_NTH_DOUBLE_FACTORIAL = require( '@stdlib/constants/float16/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 < 100; i++ ) {
    v = factorial2( i );
    if ( i > FLOAT16_MAX_NTH_DOUBLE_FACTORIAL ) {
        console.log( 'Overflow: %d', v );
    } else {
        console.log( 'Valid:    %d', v );
    }
}

C APIs

Usage

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

STDLIB_CONSTANT_FLOAT16_MAX_NTH_DOUBLE_FACTORIAL

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