Floating Point Operations in Xamarin.iOS

Xamarin.iOS will by default perform 32-bit and 64-bit floating point operations using 64-bit precision on ARM.

While this higher precision is closer to what developers expect from floating point operations in C# on the desktop, on mobile, the performance impact can be significant.

It is possible to compile your 32-bit floating point code to use 32-bit floating point operations. To do this, you need to use at least Xamarin.iOS 8.10 and set in your iOS build options's panel on the "mtouch extra arguments" entry line the following value:


This will inform the static compilers (either Mono's built-in static compiler, or the LLVM-powered one) to perform floating point operations using 32-bit floats.