Unix to Windows Porting Dictionary for HPC

RSS

Links

Function List

finite


Unix

header file: math.h

int finite(double x);
int finitef(float x);

Windows

header file: float.h

int _finite(double x);

Purpose

_finite returns a nonzero value if its argument x is not infinite; that is, if -INF < x < +INF. It returns 0 if the argument is infinite or a NAN.

Discussion

The Windows _finite() function performs in the same manner as the Unix finite() function working with a double type. There is not a matching Windows function for the Unix finitef() but it can handled with a cast as shown in the example section.

Example of Use in Windows

#include <float.h>

double mydouble;
float myfloat;
int answer1, answer2;

answer1 = _finite(mynum); /* was finite() */
answer2 = _finite((double)myfloat); /* was finitef() */
    
blog comments powered by Disqus
Valid HTML 4.01 Transitional Valid CSS!