Vector: Difference between revisions

Content added Content deleted
Line 1,410: Line 1,410:
def div / enddef
def div / enddef


def opVect /# a b op -- c #/
def opVect /# a b op -- a b c #/
var op
var op
list? not if swap len rot swap repeat endif
len var lon
len var lon
Line 1,429: Line 1,430:
getid add opVect ?
getid add opVect ?
getid sub opVect ?
getid sub opVect ?
drop 2
getid mul opVect ?
getid mul opVect ?
getid div opVect ?</lang>
getid div opVect ?</lang>
Line 1,434: Line 1,436:
<pre>[7, 10]
<pre>[7, 10]
[3, 4]
[3, 4]
[10, 21]
[10, 14]
[2.5, 2.333333333333333]
[2.5, 3.5]


=== Press any key to exit ===</pre>
=== Press any key to exit ===</pre>