TPCCLIB
Loading...
Searching...
No Matches
petc99.c File Reference

This file contains the ISO C99 functions that are not yet available in all C compilers but that are required by the PET library. More...

#include "libtpcmisc.h"

Go to the source code of this file.

Functions

int temp_roundf (float e)
 

Detailed Description

This file contains the ISO C99 functions that are not yet available in all C compilers but that are required by the PET library.

Author
Vesa Oikonen, Calle Laakkonen
Note
The functions are named as temp_functionname() to prevent problems with compilers that already have these functions.

Definition in file petc99.c.

Function Documentation

◆ temp_roundf()

int temp_roundf ( float e)

int roundf(float e) - Rounds up float e to nearest int

Parameters
efloat value
Returns
rounded integer

Definition at line 20 of file petc99.c.

21{
22#if defined(__STDC_VERSION__) && __STD_VERSION__>=199901L
23 return(roundf(e));
24#else
25 if(e<0.0) {
26 return (int)(e-0.5);
27 } else {
28 return (int)(e+0.5);
29 }
30#endif
31}

Referenced by bootstrap(), ecat63AddImg(), ecat63WriteAllImg(), ecat63WriteImageMatrix(), ecat63WriteScanMatrix(), ecat7Write2DScanMatrix(), ecat7WriteImageMatrix(), ecat7WritePolarmapMatrix(), ecat7WriteScanMatrix(), ecatCopy63to7imageheader(), img2svol(), imgMaskRoiNr(), imgSetAnalyzeHeader(), imgVoiMaskTAC(), imgWrite2DEcat7(), imgWriteAnalyze(), imgWriteAnalyzeFrame(), imgWriteEcat63Frame(), imgWriteEcat7(), imgWriteEcat7Frame(), imgWritePolarmap(), roi_onoff(), roiFillGaps(), and tsvRead().