There are several ways, the simplest one I can think of is by using the getSemantics
method:
bool IsFloat = MyFloat.getSemantics() == &APFloat::IEEEsingle;
bool IsDouble = MyFloat.getSemantics() == &APFloat::IEEEdouble;
By the way, it's more common to just check the type of the Value
that the APFloat
came from, if you have it:
bool IsFloat = MyValue.getType()->isFloatTy();
bool IsDouble = MyValue.getType()->isDoubleTy();