Csub   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/contrib/gsl.xtm

Implementation

(bind-func Csub
  (lambda (num1:gsl_complex* num2:gsl_complex*)
    (let ((n1 (bitcast num1 |2,double|*))
    (n2 (bitcast num2 |2,double|*))
    (num3:gsl_complex* (alloc))
    (n3 (bitcast num3 |2,double|*)))
      (aset! n3 0 (- (aref n1 0) (aref n2 0)))
      (aset! n3 1 (- (aref n1 1) (aref n2 1)))
      num3)))


Back to Index

Similar Entries