You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The text was updated successfully, but these errors were encountered:
setrounding(Float64, MODE)
works for these RoundingModesRoundNearest, RoundUp, RoundDown, RoundToZero
setrounding(BigFloat, MODE)
works for these RoundingModesRoundNearest, RoundUp, RoundDown, RoundToZero, RoundFromZero
to emulate
RoundFromZero
on FloatNNs (similarly with (fn, x, y) and (fn, x, y, z)If its not in the docs .. it should be (I have not looked).
The text was updated successfully, but these errors were encountered: