Subversion Repositories wimsdev

Rev

Rev 16120 | Go to most recent revision | Details | 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
9
 !goto $wims_read_parm
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
21
 !distribute items $methparmobj2 into data,left,sign,right
22
 !ifval $methparm1=0
23
  error=Division by zero!
24
  !advance penalty
25
  !exit
26
 !endif
27
 methexp=Divide \($left $sign $right) by \($methparm1)
28
 
29
 !read deduc/sub/simplify ($left) / ($methparm1)\
30
	($right) / ($methparm1)
31
 !distribute lines $out into newleft, newright
32
 !if $newleft=$empty or $newright=$empty
33
  error=bad_data
34
  !exit
35
 !endif
36
 newsign=$sign
37
 newobject2=$newleft $newsign $newright
38
 oldobject=2
39
 
40
 contextlist=$ct_Onlywhen the divisor is non-zero,\
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
45
 
46
!exit
47