Does the true value of a number change when I change its float type.?

Asked

Viewed 18 times

0

Change my data set to float32 or float16, is changing the "true" value of my data?

If I have the value 3.6, using python and reading in float64 he remains 3.6, but it changes when I put in float32, flipped 3.5999999046325684, based on IEEE 754. Making this direct conversion is changing my true value to that data?

  • 1

    Yes, these types do not have accuracy, so each one will represent in a way, will be close, but not exact.

  • @Maniero if it comes to machine Learning, change a database to float16 for example, would be modifying my original base? I did that, and I happened to achieve better accuracy and lower power consumption.

  • 1

    This might make sense, I don’t know much about the specific area, but it makes sense. In general using ML does not need as much accuracy, but achieving efficiency can be a good, although of course, if you want extreme efficiency, do not use Python.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.