setrounding(Float64, MODE) works for these RoundingModes
RoundNearest, RoundUp, RoundDown, RoundToZero
setrounding(BigFloat, MODE) works for these RoundingModes
RoundNearest, RoundUp, RoundDown, RoundToZero, RoundFromZero
to emulate RoundFromZero on FloatNNs (similarly with (fn, x, y) and (fn, x, y, z)
function roundfromzero(fn, x::T) where {T}
@nospecialize fn, x
initialmode = rounding(T)
roundingmode = signbit(x) ? RoundUp : RoundDown
setrounding( T, roundingmode)
result = fn(x)
setrounding(T, initialmode)
return result
end
If its not in the docs .. it should be (I have not looked).