1 # this is a POWER ISA 3.0B compatible div function
2 # however it is also the c, c++, rust, java *and* x86 way of doing things
7 #print ("trunc_div", n.value, d.value,
8 # abs_n.value, abs_d.value, abs_q.value,
9 # n == abs_n, d == abs_d)
10 if (n
== abs_n
) == (d
== abs_d
):
15 # this is a POWER ISA 3.0B compatible mod / remainder function
16 # however it is also the c, c++, rust, java *and* x86 way of doing things
18 return n
- d
* trunc_div(n
, d
)