Ajouter un commentaire

willbback
Quelques remaniements de code après...

J'ai tracé l'éxécution de ton programme, surtout après avoir enlever toutes les variables et fonctions statics.
Il n'y a pas de dépacement de capacité ou d'autre effet de bord sur les calculs. Les traces de l'éxécution montrent bien que la différence est négative :

norme => 0.6771649337724758
sumSQR => 0.05707986660139994
norme - sumSQR => 0.6200850671710758
norme => 1.0030697128773087
sumSQR => 0.03222925665236757
norme - sumSQR => 0.9708404562249412
norme => 1.6103219051706512
sumSQR => 1.479207586759017
norme - sumSQR => 0.13111431841163412
norme => 0.8206716593165391
sumSQR => 0.8202296274896069
norme - sumSQR => 4.4203182693214327E-4
norme => 2.33203115646992
sumSQR => 1.9012313283131725
norme - sumSQR => 0.43079982815674733
norme => 1.7277038148539423
sumSQR => 1.6565290558001564
norme - sumSQR => 0.0711747590537859
norme => 2.167547453133912
sumSQR => 2.145516661279583
norme - sumSQR => 0.022030791854329212
norme => 1.4767939326954636
sumSQR => 1.4544310947438701
norme - sumSQR => 0.02236283795159344
norme => 4.4729882524182045
sumSQR => 4.472868352812732
norme - sumSQR => 1.1989960547253986E-4
norme => 2.4951891405564304
sumSQR => 2.3602593924517876
norme - sumSQR => 0.13492974810464275
norme => 2.9211583347587533
sumSQR => 2.723605174377494
norme - sumSQR => 0.19755316038125947
norme => 3.5766665973028613
sumSQR => 2.9829678146307725
norme - sumSQR => 0.5936987826720888
norme => 4.49540328150194
sumSQR => 4.40280668680983
norme - sumSQR => 0.09259659469210924
norme => 5.026392701318516
sumSQR => 5.023688623120788
norme - sumSQR => 0.0027040781977278883
norme => 5.393425564372234
sumSQR => 5.185970951912552
norme - sumSQR => 0.20745461245968233
norme => 5.878960472224615
sumSQR => 5.463234841401164
norme - sumSQR => 0.4157256308234514
norme => 7.46242180674296
sumSQR => 7.362336686900056
norme - sumSQR => 0.10008511984290447
norme => 4.5891146021073075
sumSQR => 3.940467161329124
norme - sumSQR => 0.6486474407781837
norme => 5.805762546267093
sumSQR => 5.8047779010762275
norme - sumSQR => 9.846451908659404E-4
norme => 6.863656392523804
sumSQR => 6.862331695598104
norme - sumSQR => 0.0013246969257005858
norme => 7.587026893718924
sumSQR => 7.583958030155845
norme - sumSQR => 0.003068863563078672
norme => 8.00070710308303
sumSQR => 7.932200070631185
norme - sumSQR => 0.06850703245184508
norme => 8.154385201498945
sumSQR => 7.378167978642483
norme - sumSQR => 0.7762172228564621
norme => 8.333522523968602
sumSQR => 7.9045277653578525
norme - sumSQR => 0.42899475861074965
norme => 7.5153325105110875
sumSQR => 7.446802772173845
norme - sumSQR => 0.06852973833724274
norme => 8.043054062695509
sumSQR => 18.870764060930057
norme - sumSQR => -10.827709998234548
 NaN at i=27

Le problème est bien dans le calcul.

Filtered HTML

Plain text

CAPTCHA
Cette question permet de vérifier que vous n'êtes pas un robot spammeur :-)
  SSS    AA   X   X  L      CCC 
S A A X X L C
SSS AAAA X L C
S A A X X L C
SSSS A A X X LLLL CCC