It's fairly cumbersome to figure out the correct way to do this if you're not familiar with the intricacies of APFloat, so hopefully this can help simplify the process, and it is in the same spirit as our getAsInteger set of functions.
I didn't add a detailed set of tests, because these are already pretty well tested in APFloatTest.cpp, only the most basic cases.