Loss of precision - int -> float or double
- by stan
I have an exam question i am revising for and the question is for 4 marks
"In java we can assign a int to a double or a float". Will this ever loose infromation and why?
I have put that because ints are normally of fixed length or size - the precision for sotring data is finite, where storing information in floating point can be infinite, essentially we loose infromation because of this
Now i am a little sketchy as to whetehr or not i am hitting the right areas here. I very sure it will loose precision but i cant exactly put my finger on why. Can i getsome help please
Thanks