;; -*-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-simple-proc main (() <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)))




