math.functions: faster >rect by specializing for complex.
parent
47fbfdf1f0
commit
71d37429ba
|
@ -61,8 +61,11 @@ M: complex ^n (^n) ;
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
: >rect ( z -- x y )
|
GENERIC: >rect ( z -- x y )
|
||||||
[ real-part ] [ imaginary-part ] bi ; inline
|
|
||||||
|
M: real >rect 0 ; inline
|
||||||
|
|
||||||
|
M: complex >rect [ real-part ] [ imaginary-part ] bi ; inline
|
||||||
|
|
||||||
: >float-rect ( z -- x y )
|
: >float-rect ( z -- x y )
|
||||||
>rect [ >float ] bi@ ; inline
|
>rect [ >float ] bi@ ; inline
|
||||||
|
|
Loading…
Reference in New Issue