FGenericPlatformMath::FloatSelect

Returns value based on comparand.

Choose your operating system:

Windows

macOS

Linux

References

Module

Core

Header

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

Include

#include "GenericPlatform/GenericPlatformMath.h"

Syntax

static constexpr float FloatSelect
(
    float Comparand,
    float ValueGEZero,
    float 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

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