ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
trunc.c File Reference
#include <math.h>
#include <fenv.h>
Include dependency graph for trunc.c:

Macros

#define trunc_def(type, name, rint_func)

Functions

 trunc_def (float, truncf, rintf)
 trunc_def (double, trunc, rint)
 trunc_def (long double, truncl, rintl)

Macro Definition Documentation

◆ trunc_def

#define trunc_def ( type,
name,
rint_func )
Value:
type name(type f) \
{ \
__ESBMC_HIDE:; \
type result; \
int save_round = fegetround(); \
fesetround(FE_TOWARDZERO); \
result = rint_func(f); \
fesetround(save_round); \
return result; \
} \
\
type __##name(type f) \
{ \
__ESBMC_HIDE:; \
return name(f); \
}
int fegetround(void)
Definition fenv.c:5

Function Documentation

◆ trunc_def() [1/3]

trunc_def ( double ,
trunc ,
rint  )

◆ trunc_def() [2/3]

trunc_def ( float ,
truncf ,
rintf  )

◆ trunc_def() [3/3]

trunc_def ( long double ,
truncl ,
rintl  )