From 50c472c24216ad0c3890cb8bb9cf638e75642f0c Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 23 Jul 2013 18:47:16 -0700 Subject: renamed mVarianceSum to mSumOfSquares to be more clear fixed normalization assertions to work with megaprims added is_zero() utility function fixed unit declarations to be more clear fixed texture cache hit rate always being 0 --- indra/llmath/llmath.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/llmath') diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h index cad2461e9c..eeb5cd3ee6 100755 --- a/indra/llmath/llmath.h +++ b/indra/llmath/llmath.h @@ -113,6 +113,12 @@ inline bool is_approx_zero( F32 f ) { return (-F_APPROXIMATELY_ZERO < f) && (f < // WARNING: Infinity is comparable with F32_MAX and negative // infinity is comparable with F32_MIN +// handles negative and positive zeros +inline bool is_zero(F32 x) +{ + return (*(U32*)(&x) & 0x7fffffff) == 0; +} + inline bool is_approx_equal(F32 x, F32 y) { const S32 COMPARE_MANTISSA_UP_TO_BIT = 0x02; -- cgit v1.2.3