i'm super excited about this. i think it's a compiler bug.
check out this C# code:
float val = -3.67; // this value is not special, it's merely negative.
ushort v1 = (ushort)val;
ushort v2 = (ushort)(short)val;
short t3 = ( short)val;
ushort v3 = (ushort)t3;
when compiled with xcode 7.3.1 the result when running on certain iOS devices is that v2 and v3 will be the expected value, 65533, but v1 will be 0.
have tested iPad3 and a handful of iPad Mini's & iPhone 5, and they all have the bug,
whereas none of the iPhone 6's we've tested repro it.
also, if xcode 7.2.x is used to compile the project, the bug does not repro on any platform.
↧