Tropical algebra overloading: Difference between revisions
Content added Content deleted
m (→{{header|Factor}}: tweak stack effect) |
(→{{header|Factor}}: use typed word definitions) |
||
Line 34: | Line 34: | ||
{{works with|Factor|0.99 2021-06-02}} |
{{works with|Factor|0.99 2021-06-02}} |
||
<lang factor>USING: combinators.short-circuit io kernel math math.functions |
<lang factor>USING: combinators.short-circuit io kernel math math.functions |
||
math.order present prettyprint sequences ; |
math.order present prettyprint sequences typed ; |
||
ALIAS: ⊕ max |
ALIAS: ⊕ max |
||
ALIAS: ⊗ + |
ALIAS: ⊗ + |
||
PREDICATE: posint < integer 0 > ; |
|||
: ↑ ( x n -- |
TYPED: ↑ ( x: real n: posint -- y: real ) * ; |
||
dup { [ dup truncate number= ] [ 0 > ] } 1&& |
|||
[ "Second arg must be positive integer." throw ] unless * ; |
|||
: show ( quot -- ) |
: show ( quot -- ) |