1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
;; -*-theme-d-*-
;; Copyright (C) 2018 Tommi Höynälänmaa
;; Distributed under GNU General Public License version 3,
;; see file doc/GPL-3.
;; Expected results: translation and running OK
(define-proper-program (tests test682)
(import (standard-library core)
(standard-library math)
(standard-library console-io)
(tests numerical-test-env))
(define-main-proc (() <none> nonpure)
(report-result (exact? 1))
(report-result (exact? (rational 2 3)))
(report-result (exact? 1.0))
(report-result (exact? 1.5))
(report-result (exact? (complex 1.0 2.0)))
(report-result (exact? (complex 1.0 0.0)))
(console-newline)
(report-result (inexact? 1))
(report-result (inexact? (rational 2 3)))
(report-result (inexact? 1.0))
(report-result (inexact? 1.5))
(report-result (inexact? (complex 1.0 2.0)))
(report-result (inexact? (complex 1.0 0.0)))
(console-newline)
(report-result (exact->inexact 1))
(report-result (exact->inexact (rational 2 3)))
(report-result (exact->inexact 1.0))
(report-result (exact->inexact 1.5))
(report-result (exact->inexact (complex 1.0 2.0)))
(console-newline)
(report-result (inexact->exact 1))
(report-result (inexact->exact (rational 2 3)))
(report-result (inexact->exact 1.0))
(report-result (inexact->exact 1.5))
(report-result (inexact->exact (complex 2.0 0.0)))
(console-display "(inexact->exact (complex 2.0 1.0)): ")
(guard-without-result
(exc (else
(console-display "exception ")
(console-display-line exc)))
(console-display-line (inexact->exact (complex 2.0 1.0))))
(console-newline)))
|