mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 19:20:46 +00:00
This is a few less instructions
git-svn-id: https://svn.eduke32.com/eduke32@7618 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
968ebdef84
commit
be86eb779b
1 changed files with 3 additions and 3 deletions
|
@ -155,9 +155,9 @@ static inline float polymost_invsqrt_approximation(float x)
|
||||||
{
|
{
|
||||||
#ifdef B_LITTLE_ENDIAN
|
#ifdef B_LITTLE_ENDIAN
|
||||||
float const haf = x * .5f;
|
float const haf = x * .5f;
|
||||||
struct conv { union { uint32_t i; float f; } ; } * const n = (struct conv *)&x;
|
union { float f; uint32_t i; } n = { x };
|
||||||
n->i = 0x5f375a86 - (n->i >> 1);
|
n.i = 0x5f375a86 - (n.i >> 1);
|
||||||
return n->f * (1.5f - haf * (n->f * n->f));
|
return n.f * (1.5f - haf * (n.f * n.f));
|
||||||
#else
|
#else
|
||||||
// this is the comment
|
// this is the comment
|
||||||
return 1.f / Bsqrtf(x);
|
return 1.f / Bsqrtf(x);
|
||||||
|
|
Loading…
Reference in a new issue