Download

std math function ?

Hi,

Just wondering if we have to use std math function when coding, like for example including

**#include <algorithm>
**
in order to use

**std::max<float>(a, b);
**
Or if there is a better equivalent in UE4 ? (didn’t find it if so)

Thanks

its in the FMath:: namespace. so you have to use FMath::sine(), and etc.
For the container stuff, the built in TArrays and others have all you need.

Thanks! What mean F anyway?

Seems like it’s just an “other” prefix.

Yeah could be very cool to have the complete coding rules of UE4…

Thanks, I have replace my use to std::min by FMath !

Thanks ! Will be helpful

I suppose it is F for ‘float’ (as opposed to double).

Take a look at https://docs.unrealengine.com/latest/INT/Programming/Development/CodingStandard/index.html

F is for other class that don’t extends from UObject, AActor

You’re both right. F started with FVector as a vector of floats, but for one reason or another it’s now the prefix for all structs (required for any reflected USTRUCT(), optional for non-reflected structs but part of our coding standard).

Cheers,
Michael Noland

I vote it gets replaced by “S” then.

Just joking, April Fool’s! :wink: