def ri_up

bend-collections@1.0.0.0 · src/math/f64.bend:690

import bend-collections@1.0.0.0/src/math/f64.bend as F64
import Base
import bend-collections@1.0.0.0/src/math/u64.bend as W
import bend-collections@1.0.0.0/src/math/w64.bend as X

690# whether the integer part q (remainder r, half h of the unit) moves up one
691def ri_up(m: RMode, +s: Bool, +q: W.U64, +r: W.U64, +h: W.U64) -> Bool:
692  match m:
693    case Trunc{}:
694      False{}
695    case Floor{}:
696      Bool.and(s, Bool.not(X.is_zero(r)))
697    case Ceil{}:
698      Bool.and(Bool.not(s), Bool.not(X.is_zero(r)))
699    case Even{}:
700      Bool.or(X.lt(h, r), Bool.and(X.eq(r, h), X.odd(q)))

Uses (10)

Used by (1)