Thank you for reaching out. Internally, functions from the FMath structure will call the same implementation as their counterparts from the <cmath> standard header. What you are seeing is not Unreal-specific, but rather the effect of the Floating Point Model used by the compiler.
The “DebugGame” and “Development” configurations are comparable to applying Visual Studio’s “Debug” and “Release” configurations for your game code. While “DebugGame” uses the /fp:precise compiler option, “Development” uses /fp:fast by default, which relaxes strict adherence to floating-point standards to favor performance and memory optimizations. Importantly, /fp:fast allows the compiler to reorder, combine, or simplify floating-point operations, possibly resulting in observably different rounding behavior in some cases. You can find more information about this here.
If you need to ensure that “DebugGame” and “Development” configurations use the same Floating Point Model, the easiest way is to add the following lines to your code, on each source file that requires it:
Starting in UE 5.4 (CL 26615577, commit 36ed1de), you can also control floating-point behavior on a per-target or per-module basis by adding “FPSemantics = FPSemanticsMode.Precise;” to your TargetRules or ModuleRules class. Note, though, that changing this on a module also requires setting it up with a “PrivatePCHHeaderFile” (docs). Changing on a target requires setting it up to use a unique “BuildEnvironment” (docs).
Before UE 5.4, changing the Floating Point Model on the build system level requires building UBT from source. Look for “/fp:fast” in file “VCToolChain.cs”.
I hope this is helpful. Please let me know if you need any further assistance.