Monday 15 July 2013

java - Often big numbers become negative -


Since I started using Eclipse Project Euler, I noticed that a large number of time a random negative numbers Becomes. I think there is something to pass this type of body.

I'd appreciate it if you could explain to me how they arise negative number and what is the reasoning behind it. Also, how can I escape from them (not better with BigInteger class) Danke! =)

This picture shows what you are looking for. In your case it is clearly a large number, but the principle remains the same.

example limitation in Java:
int: 2,147,483,648 to 2,147,483,647
long: -9,223,372,036,854,775,808 of 9,223,372,036,854,775,807


image 0000, 0001, etc., binary numbers Representation represents.

Image is being interpreted as two integration

edit: the project Olr so you are often designed with a way Lagre number of problems with large numbers of working around that you can not use normal methods of troubleshooting. However, if you think that you really need to use them, I suggest BigInteger studies anyway, you will find it useful in the long run, and this is not all complicated here is a link with many sensible examples. :

No comments:

Post a Comment