Tropical algebra overloading: Difference between revisions

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

edits