Subversion Repositories wimsdev

Rev

Rev 16120 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
20 reyssat 1
!set methtit2=Divide an equation by a non-zero number
2
!set methtit=Divisde an equation by a number
3
!set methenv=ZZ QQ RR CC
4
!set methparmtype=number,parm equation
5
!set methhelp=This method transforms an equation \(A = B)\
6
 into the equivalent equation \(A/n = B/n), where \(n) is a non-zero number.
7
 
8
!if $wims_read_parm iswordof form check
16120 bpr 9
  !goto $wims_read_parm
20 reyssat 10
!endif
11
 
12
!exit
13
:form
14
 Divide the equation
15
 !read deduc/methparm.phtml 2
16
 by a number
17
 !read deduc/methparm.phtml 1,10
18
 
19
!exit
20
:check
16120 bpr 21
!distribute items $methparmobj2 into data,left,sign,right
22
!ifval $methparm1=0
20 reyssat 23
  error=Division by zero!
24
  !advance penalty
25
  !exit
16120 bpr 26
!endif
20 reyssat 27
 methexp=Divide \($left $sign $right) by \($methparm1)
28
 
16120 bpr 29
!read deduc/sub/simplify ($left) / ($methparm1)\
20 reyssat 30
	($right) / ($methparm1)
16120 bpr 31
!distribute lines $out into newleft, newright
32
!if $newleft=$empty or $newright=$empty
20 reyssat 33
  error=bad_data
34
  !exit
16120 bpr 35
!endif
36
newsign=$sign
37
newobject2=$newleft $newsign $newright
38
oldobject=2
20 reyssat 39
 
16135 bpr 40
contextlist=$ct_Onlywhen the divisor is non-zero,\
20 reyssat 41
	$ct_Onlywhen the divisor is positive,\
42
	$ct_Always,\
43
	$ct_Onlywhen the two sides are positive,\
44
	$ct_Onlywhen the two sides are of the same sign
16120 bpr 45
 
20 reyssat 46
!exit