Lines Matching refs:Abs
265 b := x.b.abs
269 f, exact = quotToFloat32(x.a.abs, b)
281 b := x.b.abs
285 f, exact = quotToFloat64(x.a.abs, b)
295 babs := b.abs
299 if &z.a == b || alias(z.a.abs, babs) {
302 z.a.abs = z.a.abs.set(a.abs)
303 z.b.abs = z.b.abs.set(babs)
317 z.b.abs = z.b.abs.setUint64(uint64(b))
324 z.b.abs = z.b.abs[:0]
331 z.b.abs = z.b.abs[:0]
344 // Abs sets z to |x| (the absolute value of x) and returns z.
345 func (z *Rat) Abs(x *Rat) *Rat {
354 z.a.neg = len(z.a.abs) > 0 && !z.a.neg // 0 has no sign
360 if len(x.a.abs) == 0 {
364 a := z.b.abs
368 b := z.a.abs
372 z.a.abs, z.b.abs = a, b // sign doesn't change
388 return len(x.b.abs) == 0 || x.b.abs.cmp(natOne) == 0
404 if len(x.b.abs) == 0 {
405 x.b.abs = x.b.abs.set(natOne) // materialize denominator
412 case len(z.a.abs) == 0:
415 z.b.abs = z.b.abs[:0]
416 case len(z.b.abs) == 0:
418 case z.b.abs.cmp(natOne) == 0:
420 z.b.abs = z.b.abs[:0]
426 z.a.abs, _ = z.a.abs.div(nil, z.a.abs, f.abs)
427 z.b.abs, _ = z.b.abs.div(nil, z.b.abs, f.abs)
428 if z.b.abs.cmp(natOne) == 0 {
430 z.b.abs = z.b.abs[:0]
458 z.abs = z.abs.mul(x.abs, f)
470 return scaleDenom(&x.a, y.b.abs).Cmp(scaleDenom(&y.a, x.b.abs))
475 a1 := scaleDenom(&x.a, y.b.abs)
476 a2 := scaleDenom(&y.a, x.b.abs)
478 z.b.abs = mulDenom(z.b.abs, x.b.abs, y.b.abs)
484 a1 := scaleDenom(&x.a, y.b.abs)
485 a2 := scaleDenom(&y.a, x.b.abs)
487 z.b.abs = mulDenom(z.b.abs, x.b.abs, y.b.abs)
494 z.b.abs = mulDenom(z.b.abs, x.b.abs, y.b.abs)
501 if len(y.a.abs) == 0 {
504 a := scaleDenom(&x.a, y.b.abs)
505 b := scaleDenom(&y.a, x.b.abs)
506 z.a.abs = a.abs
507 z.b.abs = b.abs