Fix tests for new output.
This commit is contained in:
parent
52c90628ce
commit
7fc38693ec
|
@ -1,8 +1,18 @@
|
|||
#lang typed/scheme
|
||||
(require racket/unsafe/ops)
|
||||
(map (lambda: ((x : Inexact-Complex))
|
||||
(string-append (real->decimal-string (unsafe-flreal-part x) 10)
|
||||
(real->decimal-string (unsafe-flimag-part x) 10)))
|
||||
(string-append (real->decimal-string
|
||||
(let* ([unboxed-gensym-1 x]
|
||||
[unboxed-real-2 (unsafe-flreal-part unboxed-gensym-1)]
|
||||
[unboxed-imag-3 (unsafe-flimag-part unboxed-gensym-1)])
|
||||
unboxed-real-2)
|
||||
10)
|
||||
(real->decimal-string
|
||||
(let* ([unboxed-gensym-1 x]
|
||||
[unboxed-real-2 (unsafe-flreal-part unboxed-gensym-1)]
|
||||
[unboxed-imag-3 (unsafe-flimag-part unboxed-gensym-1)])
|
||||
unboxed-imag-3)
|
||||
10)))
|
||||
(list
|
||||
(let* ((unboxed-float-1 1.0)
|
||||
(unboxed-real-2 2.0)
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
(unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-float-3 (unsafe-fl+ 1.0 2.0))
|
||||
(unboxed-real-4 (unsafe-fl+ unboxed-real-1 unboxed-float-3))
|
||||
(unboxed-imag-5 unboxed-imag-2))
|
||||
(unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5))
|
||||
(unboxed-float-5 (unsafe-fl+ 1.0 2.0))
|
||||
(unboxed-real-6 (unsafe-fl+ unboxed-real-1 unboxed-float-5))
|
||||
(unboxed-imag-7 unboxed-imag-2))
|
||||
(unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7))
|
||||
|
|
|
@ -4,57 +4,48 @@
|
|||
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-float-1 (let* ((unboxed-real-1 2.0)
|
||||
(unboxed-imag-2 4.0)
|
||||
(unboxed-real-3 3.0)
|
||||
(unboxed-imag-4 6.0)
|
||||
(unboxed-real-5 (unsafe-fl+ unboxed-real-1
|
||||
unboxed-real-3))
|
||||
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2
|
||||
unboxed-imag-4)))
|
||||
unboxed-real-5))
|
||||
(unboxed-real-2 (unsafe-fl+ unboxed-real-1 unboxed-float-1))
|
||||
(unboxed-imag-3 unboxed-imag-2))
|
||||
(unsafe-make-flrectangular unboxed-real-2 unboxed-imag-3))
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 4.0)
|
||||
(unboxed-real-5 3.0)
|
||||
(unboxed-imag-6 6.0)
|
||||
(unboxed-real-7 (unsafe-fl+ unboxed-real-3 unboxed-real-5))
|
||||
(unboxed-imag-8 (unsafe-fl+ unboxed-imag-4 unboxed-imag-6))
|
||||
(unboxed-real-9 (unsafe-fl+ unboxed-real-1 unboxed-real-7))
|
||||
(unboxed-imag-10 unboxed-imag-2))
|
||||
(unsafe-make-flrectangular unboxed-real-9 unboxed-imag-10))
|
||||
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-float-1 (let* ((unboxed-real-1 2.0)
|
||||
(unboxed-imag-2 4.0)
|
||||
(unboxed-real-3 3.0)
|
||||
(unboxed-imag-4 6.0)
|
||||
(unboxed-real-5 (unsafe-fl+ unboxed-real-1
|
||||
unboxed-real-3))
|
||||
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2
|
||||
unboxed-imag-4)))
|
||||
unboxed-real-5))
|
||||
(unboxed-real-2 (unsafe-fl+ unboxed-real-1 unboxed-float-1))
|
||||
(unboxed-imag-3 unboxed-imag-2))
|
||||
(unsafe-make-flrectangular unboxed-real-2 unboxed-imag-3))
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 4.0)
|
||||
(unboxed-real-5 3.0)
|
||||
(unboxed-imag-6 6.0)
|
||||
(unboxed-real-7 (unsafe-fl+ unboxed-real-3 unboxed-real-5))
|
||||
(unboxed-imag-8 (unsafe-fl+ unboxed-imag-4 unboxed-imag-6))
|
||||
(unboxed-real-9 (unsafe-fl+ unboxed-real-1 unboxed-real-7))
|
||||
(unboxed-imag-10 unboxed-imag-2))
|
||||
(unsafe-make-flrectangular unboxed-real-9 unboxed-imag-10))
|
||||
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-float-1 (let* ((unboxed-real-1 2.0)
|
||||
(unboxed-imag-2 4.0)
|
||||
(unboxed-real-3 3.0)
|
||||
(unboxed-imag-4 6.0)
|
||||
(unboxed-real-5 (unsafe-fl+ unboxed-real-1
|
||||
unboxed-real-3))
|
||||
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2
|
||||
unboxed-imag-4)))
|
||||
unboxed-imag-6))
|
||||
(unboxed-real-2 (unsafe-fl+ unboxed-real-1 unboxed-float-1))
|
||||
(unboxed-imag-3 unboxed-imag-2))
|
||||
(unsafe-make-flrectangular unboxed-real-2 unboxed-imag-3))
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 4.0)
|
||||
(unboxed-real-5 3.0)
|
||||
(unboxed-imag-6 6.0)
|
||||
(unboxed-real-7 (unsafe-fl+ unboxed-real-3 unboxed-real-5))
|
||||
(unboxed-imag-8 (unsafe-fl+ unboxed-imag-4 unboxed-imag-6))
|
||||
(unboxed-real-9 (unsafe-fl+ unboxed-real-1 unboxed-imag-8))
|
||||
(unboxed-imag-10 unboxed-imag-2))
|
||||
(unsafe-make-flrectangular unboxed-real-9 unboxed-imag-10))
|
||||
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-float-1 (let* ((unboxed-real-1 2.0)
|
||||
(unboxed-imag-2 4.0)
|
||||
(unboxed-real-3 3.0)
|
||||
(unboxed-imag-4 6.0)
|
||||
(unboxed-real-5 (unsafe-fl+ unboxed-real-1
|
||||
unboxed-real-3))
|
||||
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2
|
||||
unboxed-imag-4)))
|
||||
unboxed-imag-6))
|
||||
(unboxed-real-2 (unsafe-fl+ unboxed-real-1 unboxed-float-1))
|
||||
(unboxed-imag-3 unboxed-imag-2))
|
||||
(unsafe-make-flrectangular unboxed-real-2 unboxed-imag-3))
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 4.0)
|
||||
(unboxed-real-5 3.0)
|
||||
(unboxed-imag-6 6.0)
|
||||
(unboxed-real-7 (unsafe-fl+ unboxed-real-3 unboxed-real-5))
|
||||
(unboxed-imag-8 (unsafe-fl+ unboxed-imag-4 unboxed-imag-6))
|
||||
(unboxed-real-9 (unsafe-fl+ unboxed-real-1 unboxed-imag-8))
|
||||
(unboxed-imag-10 unboxed-imag-2))
|
||||
(unsafe-make-flrectangular unboxed-real-9 unboxed-imag-10))
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
(lambda (unboxed-real-1 unboxed-imag-2 l)
|
||||
(if (null? l)
|
||||
(unsafe-make-flrectangular unboxed-real-1 unboxed-imag-2)
|
||||
(let*-values (((unboxed-float-3) (->fl (unsafe-car l)))
|
||||
((unboxed-real-4) (unsafe-fl+ unboxed-real-1 unboxed-float-3))
|
||||
((unboxed-imag-5) unboxed-imag-2))
|
||||
(loop unboxed-real-4 unboxed-imag-5
|
||||
(let*-values (((unboxed-float-1) (->fl (unsafe-car l)))
|
||||
((unboxed-real-2) (unsafe-fl+ unboxed-real-1 unboxed-float-1))
|
||||
((unboxed-imag-3) unboxed-imag-2))
|
||||
(loop unboxed-real-2 unboxed-imag-3
|
||||
(unsafe-cdr l)))))))
|
||||
loop)
|
||||
unboxed-real-1 unboxed-imag-2 '(1 2 3)))
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)))
|
||||
(if (even? 2)
|
||||
(unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6)
|
||||
(let*-values (((unboxed-real-7) 2.0)
|
||||
((unboxed-imag-8) 4.0)
|
||||
((unboxed-real-9) (unsafe-fl+ unboxed-real-5 unboxed-real-7))
|
||||
((unboxed-imag-10) (unsafe-fl+ unboxed-imag-6 unboxed-imag-8)))
|
||||
(unsafe-make-flrectangular unboxed-real-9 unboxed-imag-10))))
|
||||
(let*-values (((unboxed-real-1) 2.0)
|
||||
((unboxed-imag-2) 4.0)
|
||||
((unboxed-real-3) (unsafe-fl+ unboxed-real-5 unboxed-real-1))
|
||||
((unboxed-imag-4) (unsafe-fl+ unboxed-imag-6 unboxed-imag-2)))
|
||||
(unsafe-make-flrectangular unboxed-real-3 unboxed-imag-4))))
|
||||
(void)
|
||||
|
|
Loading…
Reference in New Issue
Block a user