Elaztek Developer Hub
Blamite Game Engine - blam!  00398.09.22.23.2015.blamite
The core library for the Blamite Game Engine.
math_round.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #if defined( _MSC_VER ) && _MSC_VER < 1800
5 
6 #include "math.h"
7 
8 inline float round( float val )
9 {
10  return (val > 0.0f) ? floorf(val + 0.5f) : ceilf(val - 0.5f);
11 }
12 
13 inline float roundf( float val )
14 {
15  return (val > 0.0f) ? floorf(val + 0.5f) : ceilf(val - 0.5f);
16 }
17 
18 inline double round( double val )
19 {
20  return (val > 0.0) ? floor(val + 0.5) : ceil(val - 0.5);
21 }
22 
23 inline float exp2f( float val )
24 {
25  return powf( 2.0f, val );
26 }
27 
28 #endif