Given a divisor with rational or real coefficient we first check if all coefficients are integers. If so we make this divisor to a Weil divisor. Otherwise, an error is thrown.
i1 : R=QQ[x]
o1 = R
o1 : PolynomialRing
|
i2 : D=rationalDivisor({3/2}, {ideal(x)})
o2 = 3/2*Div(x) of R
o2 : QDiv
|
i3 : E=realDivisor({1.5}, {ideal(x)})
o3 = 1.5*Div(x) of R
o3 : RDiv
|
i4 : toWDiv(2*D)
o4 = 3*Div(x) of R
o4 : WDiv
|
i5 : toWDiv(2*E)
o5 = 3*Div(x) of R
o5 : WDiv
|
i6 : try toWDiv(D) then print "converted to a WDiv" else print "can't be converted to a WDiv"
can't be converted to a WDiv
|