From: Chris S. <san...@us...> - 2010-12-16 13:37:04
|
Update of /cvsroot/stack/stack-dev/maxima In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv10394/maxima Modified Files: assessment.mac rtest_assessment_simpboth.mac rtest_assessment_simpfalse.mac rtest_assessment_simptrue.mac Log Message: Index: rtest_assessment_simpboth.mac =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/rtest_assessment_simpboth.mac,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rtest_assessment_simpboth.mac 6 Dec 2010 19:18:25 -0000 1.3 --- rtest_assessment_simpboth.mac 16 Dec 2010 13:36:55 -0000 1.4 *************** *** 5,8 **** --- 5,10 ---- decimalplaces(1.1292,2); 1.13$ + decimalplaces(-1.1292,2); + -1.13$ decimalplaces(%pi,5); 3.14159$ *************** *** 24,27 **** --- 26,31 ---- scientific_notation(1123); 1123.0$ + significantfigures(-0.99,1); + -1$ all_listp(real_numberp,[1,exp(1)^(%i*%pi),sqrt(2)+1,sin(1)]); Index: rtest_assessment_simpfalse.mac =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/rtest_assessment_simpfalse.mac,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rtest_assessment_simpfalse.mac 6 Dec 2010 16:03:38 -0000 1.3 --- rtest_assessment_simpfalse.mac 16 Dec 2010 13:36:55 -0000 1.4 *************** *** 1,2 **** --- 1,5 ---- + scientific_notation(123.456); + 1.23456*10^2$ + factorp(x); true$ *************** *** 113,114 **** --- 116,121 ---- buggy_pow(sin(sqrt(a+b))); sin(sqrt(a)+sqrt(b))$ + + mediant(1/2,2/3); + (1+2)/(2+3)$ + Index: assessment.mac =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/assessment.mac,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** assessment.mac 6 Dec 2010 19:18:25 -0000 1.3 --- assessment.mac 16 Dec 2010 13:36:55 -0000 1.4 *************** *** 90,98 **** /* Write the number x in n decimal places */ ! decimalplaces(x,n) := block([simp:true,fpprintprec],fpprintprec:n,float(round(10^n*float(x))/(10^n)))$ /* Write numbers in significant figures */ significantfigures(x,n) := block([fpprec:128,fpprintprec,simp:true,ex,ex2], ! ex:floor(float(log(x)/log(10))), ex2:round(float(x/10^(ex-n+1))), ex2:float(ex2*10^(ex-n+1)), --- 90,98 ---- /* Write the number x in n decimal places */ ! decimalplaces(x,n) := block([fpprintprec],fpprintprec:n,ev(float(round(10^n*float(x))/(10^n)),simp))$ /* Write numbers in significant figures */ significantfigures(x,n) := block([fpprec:128,fpprintprec,simp:true,ex,ex2], ! ex:floor(float(log(abs(x))/log(10))), ex2:round(float(x/10^(ex-n+1))), ex2:float(ex2*10^(ex-n+1)), *************** *** 101,108 **** ); ! scientific_notation(x) := block([simp:true,fpprintprec,ex,ex2], ! ex:floor(float(log(x)/log(10))), ! ex2:float(x/10^ex), ! return((ex2)*10^(ex)) ); --- 101,111 ---- ); ! scientific_notation(x) := block([simp:false,fpprintprec,ex,ex2,ex3], ! if real_numberp(x) and ev(x>0,simp) then ( ! ex:ev(floor(float(log(x)/log(10))),simp), ! ex2:ev(float(x/10^ex),simp), ! ex3:ex2*10^ex, ! return(ex3) ! ) else return (x) ); *************** *** 306,313 **** /* ********************************** */ ! /* Noun arithmatic */ /* ********************************** */ ! /* ** Noun forms of the arithmatic functions ** */ /* These function define arithmetic functions which do --- 309,316 ---- /* ********************************** */ ! /* Noun arithmetic */ /* ********************************** */ ! /* ** Noun forms of the arithmetic functions ** */ /* These function define arithmetic functions which do *************** *** 378,382 **** ex:subst("noun+","+",ex), ex:subst("noun*","*",ex), ! ex:subst(lambda([ex],UNARY_MINUS noun* ex),"-",ex), /* Unary minus really communtes with multipication*/ ex:subst(lambda([ex1,ex2], ex1 noun* (UNARY_RECIP ex2)),DIV_OP,ex), /* Turn 1/x into x^(-1), in a special form */ ex:subst("noun^","^",ex), --- 381,385 ---- ex:subst("noun+","+",ex), ex:subst("noun*","*",ex), ! ex:subst(lambda([ex],UNARY_MINUS noun* ex),"-",ex), /* Unary minus really communtes with multiplication*/ ex:subst(lambda([ex1,ex2], ex1 noun* (UNARY_RECIP ex2)),DIV_OP,ex), /* Turn 1/x into x^(-1), in a special form */ ex:subst("noun^","^",ex), *************** *** 503,504 **** --- 506,510 ---- print(op(ex)) )$ + + /* Naive adding of fractions! But see Farey sequences. */ + mediant(ex1,ex2) := (num(ex1)+num(ex2))/(denom(ex1)+denom(ex2)); Index: rtest_assessment_simptrue.mac =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/rtest_assessment_simptrue.mac,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** rtest_assessment_simptrue.mac 1 Dec 2010 18:32:25 -0000 1.2 --- rtest_assessment_simptrue.mac 16 Dec 2010 13:36:55 -0000 1.3 *************** *** 8,9 **** --- 8,16 ---- "1-x"$ + mediant(1/2,2/3); + 3/5$ + mediant(1,1); + 1$ + mediant(x/y,z); + (x+z)/(y+1)$ + |