Is rust's floatingpoint mechanism consistent across platforms? In java, if you wanted to guarantee the result of an operation's decimaloutput was consistent across platforms, you would us strictfp in the method signature.
Disclaimer: I am not an expert in this area. If anyone reading this post has corrections or additions, please add them to the thread rather than notifying me directly.
One must separate consideration of the basic IEEE 754 floatingpoint operations from the libraries that implement functions such as atan
.

Most required operations: E.g.,
+
,
,*
,/
,%
, many others
These should return identical results on all modern platforms. Archaic Intel platforms that use x87 coprocessor chips may return slightly different results. 
The required
√
(sqrt
) andfusedadd
operations:
Some platforms might return results that differ. I don't know whether this is the case; if it is then olderarchitecture platforms, which may use less precision in their intermediate computations than modern platforms, are the ones more likely to introduce such variance. Platforms with software implementations of these operators may suffer similarly. 
Transcendental functions and other recommended operations: E.g.,
sin
,cos
,tan
,sinh
,cosh
,tanh
, and their inverses (atan
, etc); power and log operators such as e^{x},ln x
, etc.
These are usually library functions provided by the host system, so their results may differ depending on the host. Rust specifies the following source for these operations:use crate::sys::cmath;
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.