Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed bug in float contagion. Added test.

  • Loading branch information...
commit ebb73b7ee04271249beaa29ce8959795658ea241 1 parent 3e28a89
@tpapp authored
Showing with 11 additions and 4 deletions.
  1. +4 −4 src/elementwise.lisp
  2. +7 −0 tests/elementwise.lisp
View
8 src/elementwise.lisp
@@ -18,16 +18,16 @@ combined using arithmetic operations."
matrix))))
(declare (type (simple-array (integer 0 9) (10 10)) matrix))
(if objects
- (aref #(short-float
+ (aref #(real
+ short-float
single-float
double-float
long-float
- real
+ complex
(complex short-float)
(complex single-float)
(complex double-float)
- (complex long-float)
- complex)
+ (complex long-float))
(reduce (lambda (i1 i2) (aref matrix i1 i2)) objects
:key (lambda (object)
(cond
View
7 tests/elementwise.lisp
@@ -7,6 +7,13 @@
(:equality-test #'array=))
(addtest (elementwise-tests)
+ elementwise-float-contagion
+ (flet ((compare (type &rest objects)
+ (type= (apply #'elementwise-float-contagion objects) type)))
+ (ensure (compare 'double-float 1d0 0))
+ (ensure (compare 'real 0 1))))
+
+(addtest (elementwise-tests)
e-operations-tests
(let ((*lift-equality-test* #'array=)
(a (array* '(2 3) 'double-float
Please sign in to comment.
Something went wrong with that request. Please try again.