Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

appleweed

[java] java.lang.Math functions

This topic is 6411 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!