# Debug Game / Development間での計算の差分について 

**URL:** <https://forums.unrealengine.com/t/debug-game-development/2668723>\
**Category:** Platform & Builds\
**Tags:** unreal-engine, Epic-Pro-Support, question\
**Created:** [September 25, 2025, 2:12am UTC](https://forums.unrealengine.com/t/debug-game-development/2668723 "2025-09-25T02:12:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [September 25, 2025, 2:12am UTC](https://forums.unrealengine.com/t/debug-game-development/2668723/1 "2025-09-25T02:12:26Z")

</div>

現在以下のようなFMathを使った処理を行った際にdebug gameとdevelopmentで僅かですが誤差が出ます。

以下の処理では変数 Yに小数第６位の誤差がありました。

小数第６位レベルの差分がビルドコンフィグレーションに影響されずに処理が行われることが期待しています。

現在、UEの方でビルドコンフィグレーションによって差分が大きくなるような要因のようなものがありますでしょうか？例えばFMathを使うよりcmathを使った方が良いなどありましたら、ご教授頂けると幸いです

\<br/\>

またより精度が高いのはdebug gameでしょうか？

合わせてdebug gameはfloatでの処理を行うにあたり、developmentと全く同じ精度や桁数を情報として持っているのかご教授頂けると幸いです

```auto
FString BuildConfig = UKismetSystemLibrary::GetBuildConfiguration();
 {
 FString OutputFilePath = FPaths::ProjectDir() + TEXT("Output_other.txt");
 if (BuildConfig == TEXT("DebugGame"))
 {
 OutputFilePath = FPaths::ProjectDir() + TEXT("Output_debug.txt");
 }
 else if (BuildConfig == TEXT("Development")) 
 {
 OutputFilePath = FPaths::ProjectDir() + TEXT("Output_develop.txt");
 }
 

FString OutputString;
 
float Theta = -1.244221f;
 int TotalNum = 37;
 float Coef = 141.500000f;
 
//ベクトルの計算
 float X = FMath::Cos(2 * PI * Coef / TotalNum) * FMath::Cos(Theta);
 float Y = FMath::Sin(2 * PI * Coef / TotalNum) * FMath::Cos(Theta);
 float Z = FMath::Sin(Theta);
 
OutputString = FString::Printf(TEXT("X : %.6f Y : %.6f Z : %.6f\n"), X, Y, Z);
 FFileHelper::SaveStringToFile(OutputString, *OutputFilePath);
 }

```

---

<div class="post-metadata">

**Author:** ![VBarataBLab](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@VBarataBLab](https://forums.unrealengine.com/u/VBarataBLab)\
**Post date:** [September 26, 2025, 4:22am UTC](https://forums.unrealengine.com/t/debug-game-development/2668723/2 "2025-09-26T04:22:17Z")

</div>

Hi 佳依 山本,

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](https://learn.microsoft.com/en-us/cpp/build/reference/fp-specify-floating-point-behavior?view=msvc-170).

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:

```auto
#pragma float_control(precise, on)
#pragma fp_contract(off)

```

Starting in UE 5.4 (CL 26615577, commit [36ed1de](https://github.com/EpicGames/UnrealEngine/commit/36ed1de4ba5ec41eef35e35c005122aa26ec01d1)), 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](https://dev.epicgames.com/documentation/en-us/unreal-engine/module-properties-in-unreal-engine)). Changing on a target requires setting it up to use a unique “BuildEnvironment” ([docs](https://dev.epicgames.com/documentation/en-us/unreal-engine/unreal-engine-build-tool-target-reference)).

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.

Best regards,

Vitor
