1 ! Copyright (C) 2007 Robbert van Dalen.
2 ! See http://factorcode.org/license.txt for BSD license.
4 IN: isequences.ops.multiply
5 USING: generic kernel math math.functions sequences
6 isequences.interface isequences.base ;
9 swap i-length dup zero?
11 [ dup odd? [ over ] [ 0 ] if -rot 2/ swap _*g++ dup ++ ++ ]
14 : _*g+- ( n s -- s ) -- _* -- ; inline
16 : _*g-+ ( n s -- s ) swap -- swap _* ; inline
18 : _*g-- ( n s -- s ) [ -- ] 2apply _* ; inline
21 2dup [ neg? ] 2apply [ [ _*g-- ] [ _*g+- ] if ]
22 [ [ _*g-+ ] [ _*g++ ] if ] if ; inline
25 M: integer _* swap i-length abs * ;