cpx_test.sa


Generated by gen_html_sa_files from ICSI. Contact gomes@icsi.berkeley.edu for details
 
---------------------------> Sather 1.1 source file <--------------------------
-- test_cpx.sa: Test complex numbers
-- Author: Benedict A. Gomes <gomes@samosa.ICSI.Berkeley.EDU>
-- Copyright (C) 1995, International Computer Science Institute
-- $Id: cpx_test.sa,v 1.2 1996/04/09 10:06:00 borisv Exp $
--
-- COPYRIGHT NOTICE: This code is provided WITHOUT ANY WARRANTY
-- and is subject to the terms of the SATHER LIBRARY GENERAL PUBLIC
-- LICENSE contained in the file: Sather/Doc/License of the
-- Sather distribution. The license is also available from ICSI,
-- 1947 Center St., Suite 600, Berkeley CA 94704, USA.


class TEST_CPX

class TEST_CPX is include TEST; main is -- Test complex numbers - for now just trivial test to make sure -- they are reachable etc. class_name("CPX"); a: CPX{FLT} := #(3.0,4.0); b: CPX{FLT} := #(5.0,7.0); r: CPX{FLT} := #(8.0,11.0); c ::= a+b; test("plus",c.str,r.str); e: CPXD := #(4.0d,5.0d); d ::= e.conjugate; test("conjugate",d.str,#CPXD(4.0d,-5.0d).str); finish; end; end; -- class TEST_CPX