checkfile=$checkdir/number.proc
arglist=x
# answer must be 'x=123'
image=0
math=0
questiontype=0
!set n=$counter
!if $level =0
    R=$counter
!else
    R=$level
!endif        
#rounding=0
XSIZE=555
#!readproc $remarkdir/rounding.$taal
question$n=!record 143 of lang/remarks.$taal
#@ Los op:<br><small><em>bereken dus de waarde van x</em></small>

extratext=Gebruik bij het invoeren van je antwoord liever meer dan minder haakjes<br>Denk aan bijvoorbeeld:<table cellpadding=10><th>1/(x+1)</th><th>$m_rightarrow</th><th><img src=$module_dir/gifs/exo32a.gif></th><tr><th>2^(1+x)</th><th>$m_rightarrow</th><th><img src=$module_dir/gifs/exo32b.gif></th></table>
helptext=<a onmouseover="return escape('$extratext')"><font color=blue>Syntax Help</font></a>


!if $R=1
    a=!randitem -5,-4,-3,-2,-1,1,2,3,4,5
    d=!randitem 1,4,9,16,25,49,64,81
    !ifval $[$a*$a]=$d
	a=$[$a+1]
    !endif
    c=!randitem 0.0001,0.001,0.01,0.1,10,100,1000,10000
    C=!texmath $c
    e=$[4*log($c)/log(10)]
    
    tot=!exec pari A=($a*$a-$d)/($e)\
    printtex(A)\
    B=($d-$a*$a)/($e)\
    printtex(B)
    
    b=!line 1 of $tot
    B1=!line 2 of $tot
    B2=!line 4 of $tot
    !if $b>0
	minB=-$B1
    !else
	minB=+$B2
    !endif
    mytexsize=+4
    root=$[sqrt($d)]
    t1=$[$a-$root]
    t2=$[$a+$root]
    tot=!exec pari A=$t1/(2*$b)\
    B=$t2/(2*$b)\
    printtex(A)\
    printtex(B)
    
    t1=!line 1 of $tot
    t2=!line 2 of $tot
    t11=!line 3 of $tot
    t22=!line 4 of $tot
    x1=10^($t1)
    x2=10^($t2)
    X1=10^{$t11}
    X2=10^{$t22}
    formula$n= x^{$a $minB \cdot \log(x)}\,\,=\,\,$C
    formula$n=!replace internal -- by - in $(formula$n)
    answer$n=$x1,$x2
    texanswer$n= x_1 \,=\, $X1 \wedge x_2 \,=\, $X2
 !exit
!endif 

!if $R>1
    a=!randitem -5,-4,-3,-2,-1,1,2,3,4,5
    d=!randitem 1,4,9,16,25,49,64,81
    !if $[$a*$a]=$d
	a=$[$a+1]
    !endif
    c=!randitem 0.01,0.1,sqrt(10),10,10*sqrt(10),100,100*sqrt(10),1000*sqrt(10),sqrt(10)/10,sqrt(10)/100
    C=!texmath $c
    e=$[4*log($c)/log(10)]
    tot=!exec pari A=($a*$a-$d)/($e)\
    printtex(A)\
    B=($d-$a*$a)/($e)\
    printtex(B)
    b=!line 1 of $tot
    B1=!line 2 of $tot
    B2=!line 4 of $tot
    !if $b>0
	minB=-$B1
    !else
	minB=+$B2
    !endif
    mytexsize=+4
    root=$[sqrt($d)]
    t1=$[$a-$root]
    t2=$[$a+$root]
    tot=!exec pari A=$t1/(2*$b)\
    B=$t2/(2*$b)\
    printtex(A)\
    printtex(B)
    
    t1=!line 1 of $tot
    t2=!line 2 of $tot
    t11=!line 3 of $tot
    t22=!line 4 of $tot
    x1=10^($t1)
    x2=10^($t2)
    X1=10^{$t11}
    X2=10^{$t22}
    formula$n= x^{$a $minB \cdot \log(x)}\,\,=\,\,$C
    formula$n=!replace internal -- by + in $(formula$n)
    answer$n=$x1,$x2
    texanswer$n= x_1 \,=\, $X1 \wedge x_2 \,=\, $X2
 !exit
!endif 

