Home:ALL Converter>Why this happens in floating point conversion?

Why this happens in floating point conversion?

Ask Time:2017-01-04T16:48:54         Author:yilmazburk

Json Formatter

I noticed that some floating points converted differently. This question helps me about floating points however still don't know why this happens? I added two screenshots from debug mode about the sample code. Example values : 7.37 and 9.37. Encountered it in swift and surely swift uses IEEE 754 floating point standard Pls explain how this happens? How conversion ended differently ?

if let text = textField.text {
  if let number = formatter.number(from: text) {
     return Double(number)
  }
  return nil
}

enter image description here

enter image description here

Author:yilmazburk,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/41459608/why-this-happens-in-floating-point-conversion
yy