Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

Sign in to follow this  
geckoo

Mathf.PI

Recommended Posts

Hello friends. I have a question about Mathf.PI - The infamous 3.14159265358979 as said Unity main page information :

Please login or register to see this link.

I read somewhere that using long float numbers wastes some CPU ressources. I don't know if it is a bullshit or a fact which has been proved. In my project which is essentially a procedural shapes generation I use often Mathf.PI - an infinite float number. Do you think that I have to change it for something shorter like 3.14 or there is no real incidence? Thank you for your advice. I really appreciate it. Have a nice weekend ++

Share this post


Link to post
Share on other sites

A 32-bit float will be a 32-bit float no matter the value, and Mathf.PI is just a constant so no worries about performance.

Share this post


Link to post
Share on other sites

Thank you for your answer. Do you mean that each float number use the same 32-bit system?

3.14f and 3.14159265359f have no difference for CPU ressource?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...