Skip to content

Commit

Permalink
docfix postcondition of symmetricPower
Browse files Browse the repository at this point in the history
According to the specification of symmetricRemainder in si.spad

   symmetricRemainder     : (%, %) -> %
      ++ symmetricRemainder(a, b) (where \spad{b > 1}) yields r
      ++ where \spad{-b/2 <= r < b/2}.

the result of
```
%%% (1) -> symmetricRemainder(2,4)

   (1)  2
```
is clearly wrong (should be -2 according to the above specification).
This patch corrects the specification.
  • Loading branch information
hemmecke committed Jun 5, 2024
1 parent bb1d09c commit a37c9ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/algebra/si.spad
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ IntegerNumberSystem() : Category ==
++ where \spad{0 <= r < b} and \spad{r = a rem b}.
symmetricRemainder : (%, %) -> %
++ symmetricRemainder(a, b) (where \spad{b > 1}) yields r
++ where \spad{-b/2 <= r < b/2}.
++ where \spad{-b/2 < r <= b/2}.
rational? : % -> Boolean
++ rational?(n) tests if n is a rational number
++ (see \spadtype{Fraction Integer}).
Expand Down

0 comments on commit a37c9ef

Please sign in to comment.