Subversion Repositories wimsdev

Rev

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

!set methtit2=Divide an equation by a non-zero number
!set methtit=Divisde an equation by a number
!set methenv=ZZ QQ RR CC
!set methparmtype=number,parm equation
!set methhelp=This method transforms an equation \(A = B)\
 into the equivalent equation \(A/n = B/n), where \(n) is a non-zero number.

!if $wims_read_parm iswordof form check
 !goto $wims_read_parm
!endif

!exit
:form
 Divide the equation
 !read deduc/methparm.phtml 2
 by a number
 !read deduc/methparm.phtml 1,10

!exit
:check
 !distribute items $methparmobj2 into data,left,sign,right
 !ifval $methparm1=0
  error=Division by zero!
  !advance penalty
  !exit
 !endif
 methexp=Divide \($left $sign $right) by \($methparm1)

 !read deduc/sub/simplify ($left) / ($methparm1)\
        ($right) / ($methparm1)
 !distribute lines $out into newleft, newright
 !if $newleft=$empty or $newright=$empty
  error=bad_data
  !exit
 !endif
 newsign=$sign
 newobject2=$newleft $newsign $newright
 oldobject=2

 contextlist=$ct_Onlywhen the divisor is non-zero,\
        $ct_Onlywhen the divisor is positive,\
        $ct_Always,\
        $ct_Onlywhen the two sides are positive,\
        $ct_Onlywhen the two sides are of the same sign
 
!exit