You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/TropicalGeometry/semiring.jl
+17-3Lines changed: 17 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -90,10 +90,24 @@ convention(f::Generic.MPoly{TropicalSemiringElem{typeof(max)}}) = max
90
90
91
91
Return the min-plus (default) or max-plus semiring.
92
92
93
+
The operations `+`, `*`, `/`, and `^` are used for tropical addition, tropical
94
+
multipliciation, tropical division, and tropical exponentiation, respectively.
95
+
Zeroes of tropical semirings are printed as `infty` or `-infty` instead of their
96
+
proper unicode characters. To enable unicode in the current and future
97
+
sessions, run `allow_unicode(true)`.
98
+
93
99
!!! warning
94
-
- `+`, `*`, `/`, and `^` are used for tropical addition, tropical multipliciation, tropical division, and tropical exponentiation, respectively.
95
-
- There is no additive inverse or subtraction in the tropical semiring. Negating a tropical number or subtracting two tropical numbers will raise an error.
96
-
- Zeroes of tropical semirings are printed as `infty` or `-infty` instead of their proper unicode characters. To enabled unicode in the current and future sessions, run `allow_unicode(true)`.
100
+
- There is no additive inverse or subtraction in the tropical semiring.
101
+
Negating a tropical number or subtracting two tropical numbers will raise
102
+
an error.
103
+
- Mixing normal and tropical numbers in larger arithmetic expressions can
104
+
lead to unexpected results: Suppose `T` is the min-plus semiring. OSCAR
105
+
will interpret `1*T(1)` as `T(1)*T(1)` and return `T(2)`. Due to how julia
106
+
handles arithmetic expressions however, we have
107
+
`1*1*T(1)=(1*1)*T(1)=1*T(1)= T(2)` which is not `T(1)*T(1)*T(1)`.
108
+
The `1*1` is performed using integer multiplication, as the single
109
+
multiplication does not know that a tropical number is involved in
0 commit comments