• Advertisement
Sign in to follow this  

Simple Calculator?

This topic is 4835 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, I'm trying to make a calculator in Java, but my question isn't just related to that. On the windows calculator it seems you can enter a number way past what it will let you with a variable with type int. I was looking in my java book and it said int's are from -2billion - +2billion. In c++ unsigned is used to take out negatives and adds a extra 2 billion, but I need negavtive numbers too. Obviously I dont know too much about primitive datatype, only int's. Can double's hold more than floats. Just checking what you guys think before I go home and read my book. thanks for any comments.

Share this post


Link to post
Share on other sites
Advertisement
Use doubles. They can hold VERY large numbers and are floating point number. Or if you need integers, use longs.

Share this post


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

  • Advertisement