Made a few core functions usable with long double even when there is no std lib long double support.
Fixes #8940.