It turns out the code was not ported correctly from C and produced wrong
results for negative input values. As a bonus fix the NaN codepath by
adding yet another missing piece of code.
Spotted in #9047
56c0a66ce3LemonBoy committed on 6/11/2021, 11:04:46 AM· committed by Veikka Tuominenparent2ce033f