weight.ldivide(w)

w // weight

The left quotient of w by weight. Written weight \ w, or sometimes $(\mathit{weight})^{-1}w$. Is equivalent to right quotient on commutative weightsets. Beware that the notation lhs // rhs is somewhat misleading, and corresponds to lhs \ rhs, i.e. lhs is the divisor, and rhs the dividend.

See also:

Examples

In [1]:
import sys
import vcsn
weight = vcsn.context('lal, q').weight
weight('3').ldivide(weight('4'))
Out[1]:
$\frac{4}{3}$
In [2]:
weight('3') // weight('4')
Out[2]:
$\frac{4}{3}$
In [3]:
weight('3') / weight('4')
Out[3]:
$\frac{3}{4}$
In [4]:
weight('2') // weight('4')
Out[4]:
$2$
In [5]:
try:
    weight('0') // weight('4')
except Exception as e:
    print(e, file=sys.stderr)
Q: div: division by zero