-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 12/01/2010 02:45 PM, Roland Mainz wrote: > On Wed, Dec 1, 2010 at 10:40 PM, Matt Turner <matts...@gmail.com> wrote: >> 1/ln(2) is equivalent to log2(e), so define it as such. >> >> log2(e) = ln(e)/ln(2) = 1/ln(2) >> >> M_PI is updated to add some precision (value found in my math.h header). >> >> Signed-off-by: Matt Turner <matts...@gmail.com> >> --- >> src/mesa/main/compiler.h | 4 ++-- >> 1 files changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h >> index 5557a3b..4c52be2 100644 >> --- a/src/mesa/main/compiler.h >> +++ b/src/mesa/main/compiler.h >> @@ -351,7 +351,7 @@ static INLINE GLuint CPU_TO_LE32(GLuint x) >> >> >> #ifndef M_PI >> -#define M_PI (3.1415926536) >> +#define M_PI (3.14159265358979323846) >> #endif > > Erm... just nitpicking... it may be better to define such constants > using the C99 hexfloat format (e.g. the format which is generated for > printf "%a").
That is probably true. However, I think the only cases where we need our own definitions of these constants are the same cases where the hexfloat format is not supported. Add it to the long list of useful C99 features that we can't use. :( As far as I'm aware, Visual Studio does not support hexfloat. Nor do the AIX C compiler or the VMS C compiler. I'm sure there are a few other weird C89 compilers that core Mesa intends to support that don't do this feature. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkz22bUACgkQX1gOwKyEAw+ZZACdFY4Lxb173BHqYwEEUBaySkdw 8T8AnRy/tnXGRG1CwtI3uYZ75jWDGgHx =qZRk -----END PGP SIGNATURE----- _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev