Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
952e0be7
Commit
952e0be7
authored
Oct 02, 2008
by
Andreas Zwinkau
Browse files
Test case for historical reasons
[r22410]
parent
98b744de
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/test/invsqrt.c
0 → 100644
View file @
952e0be7
/**
* magical invsqrt function from Quake III code
* see: http://www.codemaestro.com/reviews/9
*/
float
InvSqrt
(
float
x
)
{
float
xhalf
=
0
.
5
f
*
x
;
int
i
=
*
(
int
*
)
&
x
;
i
=
0x5f3759df
-
(
i
>>
1
);
x
=
*
(
float
*
)
&
i
;
x
=
x
*
(
1
.
5
f
-
xhalf
*
x
*
x
);
return
x
;
}
int
main
(
void
)
{
int
result
=
InvSqrt
(
0
.
00056
);
printf
(
"Result: %d (should be 42)"
,
result
);
return
result
!=
42
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment