diff options
Diffstat (limited to 'src/algebra/vector.spad.pamphlet')
-rw-r--r-- | src/algebra/vector.spad.pamphlet | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/algebra/vector.spad.pamphlet b/src/algebra/vector.spad.pamphlet index 7d143b7a..38b14e15 100644 --- a/src/algebra/vector.spad.pamphlet +++ b/src/algebra/vector.spad.pamphlet @@ -340,13 +340,13 @@ DirectProduct(dim:NonNegativeInteger, R:Type): if R has CancellationAbelianMonoid then - subtractIfCan(u:%, v:%):Union(%,"failed") == + subtractIfCan(u:%, v:%) == w := new(dim,0)$Vector(R) for i in 1..dim repeat - (c := subtractIfCan(qelt(rep u, i), qelt(rep v,i))) case "failed" => - return "failed" + (c := subtractIfCan(qelt(rep u, i), qelt(rep v,i))) case nothing => + return nothing qsetelt!(w, i, c::R) - per w + just per w if R has Ring then |