-
- Downloads
Fix critical bug in realpart/imagpart.
o realpart/complex-single-float, realpart/complex-double-float, imagpart/complex-double-float, %complex-double-float, and %complex-single-float were zeroing out the result register which is ok, except when the result register and the source register are the same. Use a temp register in this case. This bit of code tickles the bug: (defun zot-r (z) (declare (type (simple-array (complex double-float) (*)) z)) (realpart (aref z 0))) (defun zot-i (z) (declare (type (simple-array (complex double-float) (*)) z)) (imagpart (aref z 0))) (let ((z (make-array 1 :element-type '(complex double-float) :initial-element #c(42d0 -42d0)))) (zot-r z)) (let ((z (make-array 1 :element-type '(complex double-float) :initial-element #c(42d0 -42d0)))) (zot-i z)) The correct results are 42d0 and -42d0, not 0d0, of course.
Loading
Please register or sign in to comment