Measurement Class angle measurement

I created a variable like so:

Code Block
var d = Measurement(Value: 360.0, unit: UnitAngle.degrees)

When I print it converted to arcMinutes:

Code Block
print(d.converted(to: UnitAngle.arcMinutes).value)


I get 21599.568008639824

which is off by about a half an arc minute.

If I create my own unit "moa"

Code Block
extension
{
public static moa = UnitAngle(symbol: "moa", converter: UnitConverterLinear(coefficient: 1.0/60.0))
}

and then print it in moa:

Code Block
print(d.converted(to: UnitAngle.moa).value)

I get 21600.0 as I would expect.

I have seen posts on StackOverflow dating back to 2018 discussing this. I guess it's still broken?

This was run on Xcode, Version 11.6.

I apologize if there are any typos in the code, I didn't run it on this computer, so I had to retype it.
Yes, still buggy.
I tested (Xcode 11.3, playground)

Also incorrect in radians
Code Block
var dd = Measurement(value: 2 * Double.pi, unit: UnitAngle.radians)
print(dd.converted(to: UnitAngle.arcMinutes).value)

get exact same value (need to quote otherwise value is displayed as 1. 008639824 !!!) :

"21599.568008639824"

Thanks, this makes me mistrust the entire units library.

I found the bug, SR-5496, the Swift issues list. Looks like it's been there for three years.

3 years later - Xcode 15.0 - Still Buggy ✓

Conversion from UnitAngle.degrees to UnitAngle.arcMinutes and UnitAngle.arcSeconds are still buggy (at least in macOS playground, I don't which version of Foundation it is uses)

Measurement Class angle measurement
 
 
Q