Understand floating-point behavior across x86 and Arm architectures
Introduction
Floating-point representation
Overflow in floating-point to integer conversion
Precision and floating-point instruction considerations
Next Steps
Understand floating-point behavior across x86 and Arm architectures
Review frequently asked questions
These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.
Check whether the operation falls into a case the standard leaves undefined, such as converting an out-of-range floating-point value to an integer. If it does, different results across architectures are permitted. For well-defined operations, results should be identical.
Verify whether the floating-point value is outside the target integer type’s range. Out-of-range conversions are explicitly undefined by IEEE 754 and can produce different results. Add a range check or guard path to avoid relying on undefined behavior.
Expect small differences in single-precision outputs between mathematically equivalent formulations when an FMA is used versus separate multiply and add. These differences arise from precision and instruction selection, not from an architectural correctness issue.
Run the same source and inputs on both Linux machines and compare outputs. For well-defined operations, the values should match. If the values don’t match, look for undefined cases or differences caused by expression ordering or FMA use.
Update code when it relies on behavior that IEEE 754 leaves undefined or on a specific evaluation order that can change. Add range checks for conversions and structure computations to avoid sensitivity to fused operations or intermediate precision.