Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/GenericPlatform
Inheritance Hierarchy
- FGenericPlatformMath
- FClangPlatformMath
References
| Module | Core |
| Header | /Engine/Source/Runtime/Core/Public/GenericPlatform/GenericPlatformMath.h |
| Include | #include "GenericPlatform/GenericPlatformMath.h" |
Syntax
struct FGenericPlatformMath
Remarks
Generic implementation for most platforms
Functions
| Type | Name | Description | |
|---|---|---|---|
| T | Abs
(
const T A |
Computes absolute value in a generic way | |
| double | Abs
(
const double A |
||
| float | Abs
(
const float A |
Float specialization | |
| float | Acos
(
float Value |
||
| double | Acos
(
double Value |
||
| bool | AddAndCheckForOverflow
(
IntType A, |
Adds two integers of any integer type, checking for overflow. | |
| float | Performs a bit cast of the given unsigned int to float of the same bit width. | ||
| double | Performs a bit cast of the given unsigned int to float of the same bit width. | ||
| float | Asin
(
float Value |
||
| double | Asin
(
double Value |
||
| uint32 | AsUInt
(
float F |
Performs a bit cast of the given float to an unsigned int of the same bit width. | |
| uint64 | AsUInt
(
double F |
Performs a bit cast of the given double to an unsigned int of the same bit width. | |
| float | Atan
(
float Value |
||
| double | Atan
(
double Value |
||
| float | Atan2
(
float Y, |
||
| double | Atan2
(
double Y, |
||
| decltype(X *Y) | Atan2
(
Arg1 X, |
||
| uint32 | CeilLogTwo
(
uint32 Arg |
Returns smallest N such that (1< |
|
| uint64 | CeilLogTwo64
(
uint64 Arg |
||
| double | CeilToDouble
(
double F |
Converts a double to the nearest greater or equal integer. | |
| float | CeilToFloat
(
float F |
Converts a float to the nearest greater or equal integer. | |
| double | CeilToFloat
(
double F |
||
| int64 | CeilToInt
(
double F |
||
| int32 | CeilToInt
(
float F |
||
| int32 | CeilToInt32
(
float F |
Converts a float to the nearest greater or equal integer. | |
| int32 | CeilToInt32
(
double F |
||
| int64 | CeilToInt64
(
double F |
||
| uint8 | ConstExprCeilLogTwo
(
SIZE_T Arg |
Returns the smallest N such that (1< |
|
| float | Cos
(
float Value |
||
| double | Cos
(
double Value |
||
| float | Cosh
(
float Value |
||
| double | Cosh
(
double Value |
||
| int32 | |||
| uint32 | CountLeadingZeros
(
uint32 Value |
Counts the number of leading zeros in the bit representation of the 32-bit value | |
| uint64 | CountLeadingZeros64
(
uint64 Value |
Counts the number of leading zeros in the bit representation of the 64-bit value | |
| uint8 | CountLeadingZeros8
(
uint8 Value |
Counts the number of leading zeros in the bit representation of the 8-bit value | |
| uint32 | CountTrailingZeros
(
uint32 Value |
Counts the number of trailing zeros in the bit representation of the value | |
| uint64 | CountTrailingZeros64
(
uint64 Value |
Counts the number of trailing zeros in the bit representation of the value | |
| float | Exp
(
float Value |
Returns e^Value. | |
| double | Exp
(
double Value |
||
| float | Exp2
(
float Value |
Returns 2^Value. | |
| double | Exp2
(
double Value |
||
| float | FloatSelect
(
float Comparand, |
Returns value based on comparand. | |
| double | FloatSelect
(
double Comparand, |
Returns value based on comparand. | |
| uint32 | Computes the base 2 logarithm for an integer value. | ||
| uint64 | FloorLog2_64
(
uint64 Value |
Computes the base 2 logarithm for a 64-bit value. | |
| double | FloorToDouble
(
double F |
Converts a double to a less or equal integer. | |
| float | FloorToFloat
(
float F |
Converts a float to the nearest less or equal integer. | |
| double | FloorToFloat
(
double F |
||
| int64 | FloorToInt
(
double F |
||
| int32 | FloorToInt
(
float F |
||
| int32 | FloorToInt32
(
double F |
||
| int32 | FloorToInt32
(
float F |
Converts a float to a nearest less or equal integer. | |
| int64 | FloorToInt64
(
double F |
||
| double | Fmod
(
double X, |
||
| 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. | |
| decltype(X *Y) | Fmod
(
Arg1 X, |
||
| float | Frac
(
float Value |
Returns the fractional part of a float. | |
| double | Frac
(
double Value |
||
| float | Fractional
(
float Value |
Returns signed fractional part of a float. | |
| double | Fractional
(
double Value |
||
| float | FRand () |
Returns a random float between 0 and 1, inclusive. | |
| int32 | GetRandSeed () |
Returns the current seed for SRand(). | |
| float | InvSqrt
(
float F |
Computes a fully accurate inverse square root | |
| double | InvSqrt
(
double F |
||
| double | InvSqrtEst
(
double F |
||
| float | InvSqrtEst
(
float F |
Computes a faster but less accurate inverse square root | |
| bool | IsFinite
(
double A |
||
| bool | IsFinite
(
float A |
Return true if value is finite (not NaN and not Infinity). | |
| bool | IsNaN
(
double A |
||
| bool | IsNaN
(
float A |
Return true if value is NaN (not a number). | |
| bool | IsNegative
(
double A |
||
| bool | IsNegative
(
float A |
||
| bool | IsNegativeDouble
(
double A |
||
| bool | IsNegativeFloat
(
float A |
||
| bool | IsNegativeOrNegativeZero
(
double A |
||
| bool | IsNegativeOrNegativeZero
(
float A |
||
| float | Load half (F16) to float https://gist.github.com/rygorous/2156668 | ||
| double | Log2
(
double Value |
1.0 / Loge(2) = 1.442695040888963387 | |
| float | Log2
(
float Value |
1.0 / Loge(2) = 1.4426950f | |
| double | Loge
(
double Value |
||
| float | Loge
(
float Value |
||
| decltype(X *Y) | LogX
(
Arg1 X, |
||
| double | LogX
(
double Base, |
||
| float | LogX
(
float Base, |
||
| T | Max of Array | ||
| decltype(X *Y) | Max
(
Arg1 X, |
Allow mixing of signed integral types. | |
| decltype(X *Y) | Max
(
Arg1 X, |
Allow mixing of float types to promote to highest precision type. | |
| T | Max
(
const T A, |
Returns higher value in a generic way | |
| VectorRegister4Float | Max
(
const VectorRegister4Float A, |
Returns the larger of the two values (operates on each component individually) | |
| VectorRegister4Double | Max
(
const VectorRegister4Double A, |
||
| VectorRegister4Float | Min
(
const VectorRegister4Float A, |
Returns the smaller of the two values (operates on each component individually) | |
| VectorRegister4Double | Min
(
const VectorRegister4Double A, |
||
| decltype(X *Y) | Min
(
Arg1 X, |
||
| T | Min
(
const T A, |
Returns lower value in a generic way | |
| decltype(X *Y) | Min
(
Arg1 X, |
||
| T | Min of Array | ||
| float | Modf
(
const float InValue, |
Breaks the given value into an integral and a fractional part. | |
| double | Modf
(
const double InValue, |
Breaks the given value into an integral and a fractional part. | |
| uint32 | MortonCode2
(
uint32 x |
Spreads bits to every other. | |
| uint64 | MortonCode2_64
(
uint64 x |
||
| uint32 | MortonCode3
(
uint32 x |
Spreads bits to every 3rd. | |
| bool | MultiplyAndCheckForOverflow
(
IntType A, |
Multiplies two integers of any integer type, checking for overflow. | |
| double | Pow
(
double A, |
||
| decltype(X *Y) | Pow
(
Arg1 X, |
||
| float | Pow
(
float A, |
||
| int32 | Rand () |
Returns a random integer between 0 and RAND_MAX, inclusive | |
| int32 | Rand32 () |
Returns a random integer between 0 and MAX_int32, inclusive. | |
| void | Seeds global random number functions Rand() and FRand() | ||
| uint32 | ReverseMortonCode2
(
uint32 x |
Reverses MortonCode2. Compacts every other bit to the right. | |
| uint64 | ReverseMortonCode2_64
(
uint64 x |
||
| uint32 | ReverseMortonCode3
(
uint32 x |
Reverses MortonCode3. Compacts every 3rd bit to the right. | |
| double | RoundToDouble
(
double F |
Converts a double to the nearest integer. Rounds up when the fraction is .5 | |
| float | RoundToFloat
(
float F |
Converts a float to the nearest integer. Rounds up when the fraction is .5 | |
| double | RoundToFloat
(
double F |
||
| int32 | RoundToInt
(
float F |
||
| int64 | RoundToInt
(
double F |
||
| int32 | RoundToInt32
(
double F |
||
| int32 | RoundToInt32
(
float F |
Converts a float to the nearest integer. Rounds up when the fraction is .5 | |
| int64 | RoundToInt64
(
double F |
||
| int64 | RoundToNearestTiesToEven
(
double F |
Converts a double to nearest int64 with ties rounding to nearest even May incur a performance penalty. | |
| uint32 | RoundUpToPowerOfTwo
(
uint32 Arg |
||
| uint64 | RoundUpToPowerOfTwo64
(
uint64 V |
||
| T | Sign
(
const T A |
Returns 1, 0, or -1 depending on relation of T to 0 | |
| double | Sin
(
double Value |
||
| float | Sin
(
float Value |
||
| double | Sinh
(
double Value |
||
| float | Sinh
(
float Value |
||
| float | Sqrt
(
float Value |
||
| double | Sqrt
(
double Value |
||
| float | SRand () |
Returns a seeded random float in the range [0,1), using the seed from SRandInit(). | |
| void | Seeds future calls to SRand() | ||
| void | Store float to half (F16) converts with RTNE = round to nearest even values too large for F16 are stored as +-Inf https://gist.github.com/rygorous/2156668 float_to_half_fast3_rtne | ||
| bool | SubtractAndCheckForOverflow
(
IntType A, |
Subtracts two integers of any integer type, checking for overflow. | |
| float | Tan
(
float Value |
||
| double | Tan
(
double Value |
||
| float | Tanh
(
float Value |
||
| double | Tanh
(
double Value |
||
| double | TruncToDouble
(
double F |
Converts a double to an integer value with truncation towards zero. | |
| float | TruncToFloat
(
float F |
Converts a float to an integer value with truncation towards zero. | |
| double | TruncToFloat
(
double F |
||
| int32 | TruncToInt
(
float F |
||
| int64 | TruncToInt
(
double F |
||
| int32 | TruncToInt32
(
float F |
Converts a float to an integer with truncation towards zero. | |
| int32 | TruncToInt32
(
double F |
||
| int64 | TruncToInt64
(
double F |
||
| void | VectorLoadHalf
(
float*__restrict Dst, |
||
| void | VectorStoreHalf
(
uint16*__restrict Dst, |
||
| void | WideVectorLoadHalf
(
float*__restrict Dst, |
||
| void | WideVectorStoreHalf
(
uint16*__restrict Dst, |