Measurement converted(to:) is providing the wrong answer
Originator: | jeffkempster | ||
Number: | rdar://38641535 | Date Originated: | 3/19/2018 |
Status: | Open | Resolved: | |
Product: | iOS | Product Version: | 11 |
Classification: | Bug | Reproducible: | Always |
Area: Foundation Summary: If you use the built in Measurement class and function to convert(to:) from miles to feet the result in not accurate. In my example converting 1 mile to feet provides 5279.98687664042 ft Steps to Reproduce: import Foundation let lengthMiles = Measurement(value: 1, unit: UnitLength.miles) // 1.0 mi let lengthFeet = lengthMiles.converted(to: UnitLength.feet) // 5279.98687664042 ft Expected Results: Should return 5280.0 ft Actual Results: Returns 5279.98687664042 ft Version/Build: Version 9.2 (9C40b). MacOS 10.13.3 (17D102) Configuration: 2016 MacBook Pro 15"
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!