diff options
| author | TakaRikka <38417346+TakaRikka@users.noreply.github.com> | 2021-11-10 23:54:31 -0800 |
|---|---|---|
| committer | TakaRikka <38417346+TakaRikka@users.noreply.github.com> | 2021-11-10 23:54:31 -0800 |
| commit | 70eabb12bd5e9327ccd01b1f9367fca109d4fbfa (patch) | |
| tree | bc478c843622a25b54dd87479b6575be425b7488 /include/JSystem/JMath | |
| parent | 74ed2da8bc93804373cddf64c0c878603150b699 (diff) | |
wip
Diffstat (limited to 'include/JSystem/JMath')
| -rw-r--r-- | include/JSystem/JMath/JMath.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/JSystem/JMath/JMath.h b/include/JSystem/JMath/JMath.h index d71f5de5e7..cb252d9aea 100644 --- a/include/JSystem/JMath/JMath.h +++ b/include/JSystem/JMath/JMath.h @@ -10,6 +10,14 @@ inline f32 JMAFastReciprocal(f32 value) { return __fres(value); } +inline f32 JMAFastSqrt(f32 input) { + if (input > 0.0f) { + f64 tmp = __frsqrte(input); + return tmp * input; + } + return input; +} + namespace JMath { inline f32 fastReciprocal(f32 value) { |
