Skip to main content
gamedev.net
🔒 Locked

[java] java.lang.Math functions

Started by appleweed 1 reply 750+ views
Original Post
appleweed
appleweed
Hey all... I was fiddling around with optimizing some code and I used a typical approximation to replace the SQRT() function. (This is common when coding vector length calculcations in C.) Funny thing, I tried several well-known approximations and found that my code, at best, ran as fast as the Math.sqrt() call or _slower_! I''m using JDK 1.3... anyone know if Sun has made the math library functions as optimized as possible? -Omar --- "We are Indigenous. Welcome." Indigenous Technologies, Inc.
---"We are Indigenous. Welcome."Indigenous Technologies, Inc.
snowmoon
snowmoon
Yes, the Math library is ( I believe ) all calls to native routines that are optimized. For many of them the call overhead is much larger than the acutal math.
appleweed
appleweed
Thanks, Snowmoon!

---

"We are Indigenous. Welcome."
Indigenous Technologies, Inc.
---"We are Indigenous. Welcome."Indigenous Technologies, Inc.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.