bewerking=bewerking2.proc
operator=-
n=$teller
!if $graad=0
    R=$teller
!else
    R=$graad
!endif
!if $R=1    
    getal=!randitem 1,2,3,4,5
    TELLER1=!randitem -1,-3,-5
    factor=!randitem 1,2,3,4
    NOEMER1=$[-1*$TELLER1+$factor]
!endif


!if $R=2    
    TELLER1=!randitem -1,-3,-5
    getal=!randitem 1,2,3,4,5
    factor=!randitem 1,2,3,4,5
    NOEMER1=$[-1*$TELLER1+$factor]
!endif

!if $R=3    
    TELLER1=!randitem -1,-3,-5
    getal=!randitem 1,2,3,4,5,6
    factor=!randitem 2,4,6,8 
    NOEMER1=$[$TELLER1+$factor]
!endif


!if $R>3    
    getal=!randitem 1,2,3,4,5,6
    TELLER1=!randitem -1,-3,-5
    factor=!randitem 2,4,6,8,10
    NOEMER1=$[$TELLER1+$factor]
!endif




##ant1/ant2 + ant3/ant4 = ant5/ant6 
##GOED1/GOED2 + GOED3/GOED4 = GOED5/GOED6

GG=!exec pari $getal $operator $TELLER1/$NOEMER1
!if / notin $GG
    GOED5=$GG
    GOED6=1
    EXTRA=  = $GOED5
!else
    GG=!replace internal / by , in $GG
    GOED5=!item 1 of $GG
    GOED6=!item 2 of $GG
    EXTRA=
!endif

GOED1=$[$getal*$GOED6]
GOED2=$[$GOED6]
GOED3=$TELLER1
GOED4=$NOEMER1

!if $taal=nl
    nivo_title=een negatieve breuk en een getal aftrekken
    somtekst$n=<p align="left">Maak eerst gelijknamige breuken.<br>\
    En trek de dan (negatieve) breuk en het getal van elkaar af en vereenvoudig het resultaat.<br>
!else
    nivo_title=Subtraction of a negative fracton and an integer.
    somtekst$n=<p align="left">The first step is to make two fractions with common denominators.<br>\
    Then subtract the two fractions...<br>If possible reduce the outcome.
!endif

opgave$n=$getal - \frac{$TELLER1}{$NOEMER1} =
antwoord$n=$getal - \frac{$TELLER1}{$NOEMER1} = \frac{$GOED1}{$GOED2} - \frac{$GOED3}{$GOED4} = \frac{$GOED1 - $GOED3}{$GOED6} = \frac{$GOED5}{$GOED6} $EXTRA
