Subversion Repositories wimsdev

Rev

Rev 16135 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
20 reyssat 1
!set methtit2=Multiply an equation by a non-zero number
2
!set methtit=Multiply 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 number,\
7
 which must be non-zero in order to guarantie the equivalence of the\
8
 originating equation and the transformed one.
9
 
10
!if $wims_read_parm iswordof form check
16135 bpr 11
  !goto $wims_read_parm
20 reyssat 12
!endif
13
 
14
!exit
15
:form
16
 Multiply the equation
17
 !read deduc/methparm.phtml 2
18
 by the number
19
 !read deduc/methparm.phtml 1,10
20
 
21
!exit
22
:check
16135 bpr 23
!distribute items $methparmobj2 into data,left,sign,right
24
!if $methparm1=0
20 reyssat 25
  error=Multiply an equation by 0 makes you lose information, and is therefore\
16209 bpr 26
    prohibited.
20 reyssat 27
  !advance penalty
28
  !exit
16135 bpr 29
!endif
30
methexp=Multiply \($left $sign $right) by \($methparm1)
20 reyssat 31
 
16135 bpr 32
!read deduc/sub/simplify ($left) * ($methparm1)\
20 reyssat 33
	($right) * ($methparm1)
16135 bpr 34
!distribute lines $out into newleft,newright
35
!if $newleft=$empty or $newright=$empty
20 reyssat 36
  error=bad_data
37
  !exit
16135 bpr 38
!endif
39
newsign=$sign
40
newobject2=$newleft $newsign $newright
41
oldobject=2
20 reyssat 42
 
16135 bpr 43
contextlist=$ct_Onlywhen the multiplier is non-zero,\
20 reyssat 44
	$ct_Onlywhen the multiplier is positive,\
45
	$ct_Onlywhen the two sides are positive,\
46
	$ct_Onlywhen the two sides are of the same sign
16135 bpr 47
 
20 reyssat 48
!exit