File:  [CENS] / python / pyGiNaC / test / add.tst
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Tue Mar 13 06:39:47 2001 UTC (16 years, 8 months ago) by pearu
Branches: MAIN
CVS tags: HEAD
Separated tests

#
# $Id: add.tst,v 1.1 2001-03-13 06:39:47 pearu Exp $
# Pearu Peterson

_startup = __import__('__startup__')
module = __import__('GiNaC._ginac',globals(),locals(),['_ginac'])

isinstance(add(ex(),ex()),add) :: 1
isinstance(add(ex(),ex()),expairseq) :: 1
isinstance(add(ex(),ex()),basic) :: 1
isinstance(add(exvector()),add) :: 1
isinstance(add(ex(),ex()),ex) :: 0
isinstance(add(ex(),ex()),mul) :: 0

add(ex(),ex()).print_(0) :: 
add(ex(),ex(numeric("3"))).print_(0) :: 3
add(ex(numeric("2")),ex(numeric("3"))).print_(0) :: 5
add(ex(symbol("a")),ex(numeric("3"))).print_(0) :: 3+a
add(ex(symbol("a")),ex(symbol("b"))).print_(0) :: b+a

add(ex(),ex()).printraw().split('=')[0] :: +(,hash#=1,flags=0)
add(ex(),ex()).printtree(0).split('hash')[0] :: type=add,#hash=1(0x1),flags=0,nops=0\n=====\n
add(ex(symbol("a")),ex(numeric("5"))).printcsrc(0,0) :: a+5.000000e+00
add(ex(symbol("a")),ex(numeric("5"))).printcsrc(1,0) :: a+5.000000e+00
add(ex(symbol("a")),ex(numeric("5"))).printcsrc(2,0) :: a+cln::cl_F("5.0")

add(exvector((ex(),))).print_(0) :: 
add(exvector((ex(),ex(symbol("a"))))).print_(0) :: a 
add(exvector((ex(symbol("i")),ex(symbol("a"))))).print_(0) :: i+a
add(exvector((ex(symbol("i")),ex(numeric("-7"))))).print_(0) :: -7+i
add(exvector((ex(numeric("3")),ex(5)))).print_(0) :: 8
add(exvector((ex(numeric(3.37)),ex(5)))).print_(0)[:5] :: 8.370

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>