Jump to content
  • Advertisement
Sign in to follow this  
cruppstahl

lua: number always double?

This topic is 3514 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

hi, in my application i work a lot with 64bit numbers. i barely need floats/reals, only few of them. would u recommend me to change the number definition of the lua compiler/runtime to uint64, or would u rather recommend that i continue to use doubles, and use them for my calculations? i actually would like to NOT change the lua configuration, but it just "feels weird" to perform my uint64-stuff with doubles :) thanks Chris

Share this post


Link to post
Share on other sites
Advertisement
Quote:

i barely need floats/reals, only few of them.

Then I would stick with them.

Quote:

would u recommend me to change the number definition of the lua compiler/runtime to uint64, or would u rather recommend that i continue to use doubles, and use them for my calculations?

I would certainly not. If you were having considerable performance problems then maybe. But because it could potentially break any code which does any kind of math I would advise against it.

Quote:

it just "feels weird" to perform my uint64-stuff with doubles

You'd be surprised how quick you forget that is what is happening under the hood [wink]

Share this post


Link to post
Share on other sites
thanks for the reply.

i do not have any performance worries. but my C routines are based on uint64, and i surely will use the whole address space. i was initially worried about conversion errors, but i guess that's silly (my "math" is very simple, just addition/substraction and shifting bits (mul/div by 8).

i'll stick with the doubles...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!