Rev 16117 | 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=Diviser une inégalité par un nombre non-nul |
2 | !set methtit=Diviser une inégalité par un nombre |
||
3 | !set methenv=ZZ QQ RR |
||
4 | !set methparmtype=number,parm inequality |
||
5 | !set methhelp=Cette méthode transforme une inégalité du style \(A > B)\ |
||
6 | en l'inégalité équivalente \(A/n > B/n) (ou \(A/n < B/n)), où \(n) est un nombre\ |
||
7 | non-nul. |
||
8 | |||
9 | !if $wims_read_parm iswordof form check |
||
16117 | bpr | 10 | !goto $wims_read_parm |
20 | reyssat | 11 | !endif |
12 | |||
13 | !exit |
||
14 | :form |
||
16117 | bpr | 15 | Diviser l'inégalité |
16 | !read deduc/methparm.phtml 2 |
||
16120 | bpr | 17 | $ par un nombre |
16117 | bpr | 18 | !read deduc/methparm.phtml 1,10 |
20 | reyssat | 19 | |
20 | !exit |
||
21 | :check |
||
16117 | bpr | 22 | !distribute items $methparmobj2 into data,left,sign,right |
23 | !ifval $methparm1=0 |
||
20 | reyssat | 24 | error=Division par zéro ! |
25 | !advance penalty |
||
26 | !exit |
||
16117 | bpr | 27 | !endif |
28 | methexp=Diviser \($left $sign $right) par \($methparm1) |
||
20 | reyssat | 29 | |
16117 | bpr | 30 | !read deduc/sub/simplify ($left) / ($methparm1)\ |
20 | reyssat | 31 | ($right) / ($methparm1) |
16117 | bpr | 32 | !distribute lines $out into newleft, newright |
33 | !if $newleft=$empty or $newright=$empty |
||
20 | reyssat | 34 | error=bad_data |
35 | !exit |
||
16117 | bpr | 36 | !endif |
37 | !if $methparm1<0 |
||
20 | reyssat | 38 | newsign=!translate internal <> to >< in $sign |
16117 | bpr | 39 | !else |
20 | reyssat | 40 | newsign=$sign |
16117 | bpr | 41 | !endif |
42 | newobject2=$newleft $newsign $newright |
||
43 | oldobject=2 |
||
20 | reyssat | 44 | |
16117 | bpr | 45 | contextlist=$ct_Onlywhen le diviseur est non-nul,\ |
20 | reyssat | 46 | $ct_Onlywhen le diviseur est positif,\ |
47 | $ct_Always,\ |
||
48 | $ct_Onlywhen les deux côtés sont positifs,\ |
||
49 | $ct_Onlywhen les deux côtés sont de même signe,\ |
||
50 | $ct_Onlywhen l'inégalité est stricte |
||
16117 | bpr | 51 | |
52 | badsign=!translate internal <> to >< in $newsign |
||
20 | reyssat | 53 | resultlist=$newobject2,\ |
54 | $newright $newsign $newleft,\ |
||
55 | $newleft $badsign $newright |
||
56 | |||
57 | !exit |