Cannot find multiplatform arithmetic operations si...
# multiplatform
Cannot find multiplatform arithmetic operations similar to Java's,long) Think it would be great to have arithmetic overflow handling for kotlin multiplatform.
I implemented some of these for Island Time (, though they're internal to the library. It uses the Java methods on JVM and a pure Kotlin implementation (partially adapted from threetenbp) for the other platforms. Have a look at internal/Math.kt if you're interested. The pure Kotlin implementations are pretty slow, unfortunately. I experimented with calling into native C code using the compiler built-ins for checked arithmetic, but the call overhead from K/N seems to far outweigh any benefits. It'd be nice to have this in the standard library. I imagine that would make it possible to add some intrinsics to use the built-ins directly in the generated code, significantly improving the performance.