attached a better version with exp2f fix too. as far as i can tell other functions handle -nan correctly, but i will have to do some -nan testing.