Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-09-15 21:29:18 +0000
committerStijn Buys <ingar@osirion.org>2010-09-15 21:29:18 +0000
commite55638d081e2e1ff6fbc06e0e8ac0381a04308e7 (patch)
tree511ccb478adf2acd3cc93f66d217b09f3e3a06dc /src/math/functions.h
parentf612f19e095b8d0ba49f5bcdec6a582824315d69 (diff)
updated comments, updated buy menu, info support for map window, added const to target selection
Diffstat (limited to 'src/math/functions.h')
-rw-r--r--src/math/functions.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/math/functions.h b/src/math/functions.h
index c301969..5a53d44 100644
--- a/src/math/functions.h
+++ b/src/math/functions.h
@@ -31,7 +31,7 @@ int max(int a, int b);
/** The value returned will be in the interval [0-max]
* @param max the maximum value returned
**/
-float randomf(const float max = 1);
+float randomf(const float max = 1.0f);
/// returns a random integer
/** The value returned will be in the interval [0-(max-1)]
@@ -58,12 +58,9 @@ inline void clamp(float &value, const float min = 0.0f, const float max = 1.0f)
}
/// return the absolute value of a float
-inline float absf(float f)
+inline float absf(const float f)
{
- if (f < 0)
- return -f;
- else
- return f;
+ return ( f < 0.0f ? -f : f );
}
} // namespace math