8
LINES
< > BotCompany Repo | #1024278
// unprecise_invSqrt - the infamous inverse square root approximation
JavaX fragment (include)
1 | static float unprecise_invSqrt(float x) {
|
2 | float xhalf = 0.5f * x;
|
3 | int i = Float.floatToIntBits(x);
|
4 | i = 0x5f3759df - (i >> 1);
|
5 | x = Float.intBitsToFloat(i);
|
6 | x *= (1.5f - xhalf * x * x);
|
7 | ret x;
|
8 | } |
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
ID |
Author/Program |
Comment |
Date |
1380 | stefan | From https://stackoverflow.com/questions/11513344/how-to-implement-the-fast-inverse-square-root-in-java | 2019-07-29 11:31:54 |
add comment
Snippet ID: |
#1024278 |
Snippet name: |
unprecise_invSqrt - the infamous inverse square root approximation |
Eternal ID of this version: |
#1024278/1 |
Text MD5: |
9f21f44439309378799c64c01a193cbb |
Author: |
stefan |
Category: |
javax / maths |
Type: |
JavaX fragment (include) |
Public (visible to everyone): |
Yes |
Archived (hidden from active list): |
No |
Created/modified: |
2019-07-29 11:31:37 |
Source code size: |
211 bytes / 8 lines |
Pitched / IR pitched: |
No / No |
Views / Downloads: |
286 / 324 |
Referenced in: |
[show references] |