[flang][runtime] Fix NEAREST() when exponent decreases (#75368)
When the result of NEAREST() has an exponent less than that of the argument (e.g., NEAREST(1.,-1.) and NEAREST(-1.,1.)), the result was wrong, because the increment value uses the result of SPACING() in terms of the argument. Fix by just calling into the C runtime routine std::nextafter().
Loading
Please sign in to comment