diff options
author | Ales Tamchyna <tamchyna@ufal.mff.cuni.cz> | 2015-01-06 12:55:11 +0300 |
---|---|---|
committer | Ales Tamchyna <tamchyna@ufal.mff.cuni.cz> | 2015-01-06 12:55:11 +0300 |
commit | 416c819f799654a6d2a798c8803ad8a610aa06d2 (patch) | |
tree | df60122416f38f56fdd48d70ca5429f848f590f3 /moses/Util.h | |
parent | 4e334f2b4e11ea2a89699a72e63a01fe1f3113b5 (diff) |
minor
Diffstat (limited to 'moses/Util.h')
-rw-r--r-- | moses/Util.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/moses/Util.h b/moses/Util.h index 11be058ae..11a929b68 100644 --- a/moses/Util.h +++ b/moses/Util.h @@ -483,6 +483,12 @@ T log_sum (T log_a, T log_b) return ( v ); } +inline bool Equals(float a, float b) +{ + return fabs(a - b) < FLOAT_EPSILON; +} + + /** Enforce rounding */ inline void FixPrecision(std::ostream& stream, size_t size = 3) { |