operator=-
bewerking=bewerking2.proc
n=$teller
!if $graad=0
    R=$teller
!else
    R=$graad
!endif
!if $R=1    
    TELLER1=!randitem 5,6,7,8
    TELLER2=!randitem 1,2,3,4
    NOEMER1=!randitem 9,10,11,12
    factor=!randitem 2,3
    NOEMER2=$[$NOEMER1*$factor]    
    GOED1=$[$TELLER1*$factor]
    GOED2=$NOEMER2
    GOED3=$TELLER2
    GOED4=$NOEMER2
!endif

!if $R=2    
    TELLER2=!randitem 2,3,4,5,7,8,9
    extra=!randitem 1,2,3,4,5
    TELLER1=$[$TELLER2+$extra]
    NOEMER1=!randitem 10,11,12,13,14,15,16
    factor=!randitem 2,3,4,5,6
    NOEMER2=$[$NOEMER1*$factor]    
    GOED1=$[$TELLER1*$factor]
    GOED2=$NOEMER2
    GOED3=$TELLER2
    GOED4=$NOEMER2
!endif

!if $R>2    
    TELLER2=!randitem 2,3,4,5,7,8,9
    extra=!randitem 3,4,5,6,7,8
    TELLER1=$[$TELLER2+$extra]
    NOEMER1=!randitem 10,11,12,13,14,15,16
    factor=!randitem 2,3,4,5,6,7,8
    NOEMER2=$[$NOEMER1*$factor]    
    GOED1=$[$TELLER1*$factor]
    GOED2=$NOEMER2
    GOED3=$TELLER2
    GOED4=$NOEMER2
!endif


##ant1/ant2 - ant3/ant4 = ant5ant6 
##GOED1/GOED2 - GOED3/GOED4 = GOED5/GOED6

GGG=!exec pari ($GOED1 $operator $GOED3)/$NOEMER2

!if / notin $GGG
    GOED5=$GGG
    GOED6=1
!else
    GGG=!replace internal /  by , in $GGG
    GOED5=!item 1 of $GGG
    GOED6=!item 2 of $GGG
!endif
antwoord$n=\frac{$TELLER1}{$NOEMER1} $operator \frac{$TELLER2}{$NOEMER2}  = \frac{$factor \cdot $TELLER1}{$factor \cdot $NOEMER1} - \frac{$TELLER2}{$NOEMER2} = \frac{$[$factor*$TELLER1] - $TELLER2}{$NOEMER2}  =  \frac{$GOED5}{$GOED6}

!if $taal=nl
    nivo_title=twee breuken gelijknamig maken en aftrekken & vereenvoudigen
    somtekst$n=<p align="left">Maak de volgende twee breuken <b>gelijknamig.</b><br>\
    <small>maak dus de beide noemers gelijk</small><br>\
    en trek ze daarna van elkaar af...<br>\
    <small>Het eindantwoord moet je natuurlijk wel vereenvoudigen.<br>\
    dus 2/4 wordt 1/2</small><p>
!else
    nivo_title=Subtraction of two fractions
    somtekst$n=<p align="left">First find a common denominator.<br>\
    And then subtract the two fractions.<br>\
    <small>naturally you must reduce the outcome<br>thus 2/4 --> 1/2</small><p>
!endif
opgave$n=\frac{$TELLER1}{$NOEMER1} $operator  \frac{$TELLER2}{$NOEMER2} =


