Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/FGenericPlatformMath
Overloads
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static float Fmod
(
float X, |
Returns the floating-point remainder of X / Y Warning: Always returns remainder toward 0, not toward the smaller multiple of Y. | GenericPlatform/GenericPlatformMath.h | |
static double Fmod
(
double X, |
GenericPlatform/GenericPlatformMath.h | ||
static decltype(X *Y) Fmod
(
Arg1 X, |
GenericPlatform/GenericPlatformMath.h |
Fmod(float, float)
Description
Returns the floating-point remainder of X / Y Warning: Always returns remainder toward 0, not toward the smaller multiple of Y. So for example Fmod(2.8f, 2) gives .8f as you would expect, however, Fmod(-2.8f, 2) gives -.8f, NOT 1.2f Use Floor instead when snapping positions that can be negative to a grid
This is forced to NOT inline so that divisions by constant Y does not get optimized in to an inverse scalar multiply, which is not consistent with the intent nor with the vectorized version.
| Name | Fmod |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/GenericPlatform/GenericPlatformMath.h |
| Include Path | #include "GenericPlatform/GenericPlatformMath.h" |
| Source | /Engine/Source/Runtime/Core/Private/GenericPlatform/GenericPlatformMath.cpp |
static float Fmod
(
float X,
float Y
)
Fmod(double, double)
| Name | Fmod |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/GenericPlatform/GenericPlatformMath.h |
| Include Path | #include "GenericPlatform/GenericPlatformMath.h" |
| Source | /Engine/Source/Runtime/Core/Private/GenericPlatform/GenericPlatformMath.cpp |
static double Fmod
(
double X,
double Y
)
Fmod(Arg1, Arg2)
| Name | Fmod |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/GenericPlatform/GenericPlatformMath.h |
| Include Path | #include "GenericPlatform/GenericPlatformMath.h" |
template<typename Arg1, typename Arg2, std::enable_if_t<((std::is_floating_point_v< Arg1 >||std::is_floating_point_v< Arg2 >) &&!std::is_same_v< Arg1, Arg2 >), int >>
static decltype(X *Y) Fmod
(
Arg1 X,
Arg2 Y
)