FGenericPlatformMath::FloatSelect

Returns value based on comparand.

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/GenericPlatform/GenericPlatformMath.h

Include

#include "GenericPlatform/GenericPlatformMath.h"

Syntax

static constexpr double FloatSelect
(
    double Comparand,
    double ValueGEZero,
    double ValueLTZero
)

Remarks

Returns value based on comparand. The main purpose of this function is to avoid branching based on floating point comparison which can be avoided via compiler intrinsics.

Please note that we don't define what happens in the case of NaNs as there might be platform specific differences.

Returns

ValueGEZero if Comparand >= 0, ValueLTZero otherwise

Parameters

Parameter

Description

Comparand

Comparand the results are based on

ValueGEZero

Return value if Comparand >= 0

ValueLTZero

Return value if Comparand < 0

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss