Subversion Repositories wimsdev

Rev

Rev 539 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
539 bpr 1
!goto $wims_read_parm
2
 
3
:def
4
title=Racines de polynômes
5
synonyme=racine polynomiale, polynome racine
6
input=polynomial1
7
!exit
8
 
9
:proc
10
 
11
fml=!lines2items $formula
12
fml=!rawmath $fml
13
 
14
pari_precision=$precision
15
result=!exec pari print(polroots($fml)~)
16
 
17
result=!declosing $result
18
result=!trim $result
19
!if $result=$empty
20
 error=solve_fail
21
 !exit
22
!endif
23
result=!replace internal , by , $ in $ $result
24
result=!replace internal $ 0.0 + 0.0*I by 0 in $result
25
result=!replace internal $ 0.0 + by $ in $result
26
result=!replace internal $ 0.0 - by $ - in $result
27
result=!replace internal $ + 0.0*I by $ in $result
28
result=!replace internal $ - 0.0*I by $ in $result
29
result=!singlespace $result
30
!exit
31
 
32
:output
33
Racines du polynôme
34
!htmlmath $fml
35
$ :
36
!endif
6055 bpr 37
<table class="wimscenter wimsnoborder">
539 bpr 38
!set n=!itemcnt $result
39
!for i=1 to $n
40
 !set l=!item $i of $result
6055 bpr 41
 <tr><td><i>r</i><sub>$i</sub> =
539 bpr 42
 !htmlmath $l
6055 bpr 43
 </td></tr>
539 bpr 44
!next i
6055 bpr 45
</table>
539 bpr 46
!exit
47