Unix to Windows Porting Dictionary for HPC |
||
|
|
||
|
|
LinksFunction List
|
Table of Contents header file: math.h long long llrint(double x); long long llrintf(float x); long lrint(double x); long lrintf(float x); header file: math_u.h long long llrint(double x); long long llrintf(float x); long lrint(double x); long lrintf(float x); These are a set of functions that convert float and double type variables to integers of types long (32-bit) and long long (64-bit). These functions are not part of the available Windows functions. A zip file containing useful math functions is provided which contains these functions. The zip file can be obtained at the link listed at the bottom of this page (More Information). An include file (math_u.h) for setting prototypes and macro definitions is provided with the zip file.
#include <math_u.h>
double mydouble;
float myfloat;
long mylong
long long mylonglong;
/* These two functions both have a double type as the argument */
mylonglong = llrint(mydouble);
mylong = lrint(mydouble);
/* These two functions both have a float type as the argument */
mylonglong = llrintf(myfloat);
mylong = lrintf(myfloat);
|