Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your <code>@Degre</code> gets changed inside the loop every time where as <code>aa</code> <code>bb</code> and <code>step</code> remains unchanged. </p> <pre><code> print "$aa[1] $bb[1] $Degre[1] $step[1] \n"; </code></pre> <p>The above shows correct value as calculated in </p> <pre><code> @Degre = map {$Degre[$_] + $step[$_]} (1..2000); </code></pre> <p>Print <code>@xx</code> and <code>@yy</code> in your print statement instead of <code>@aa</code> and <code>@bb</code> and see the values change as per calculation.</p> <p>Put a <code>@Degre=sort(@Degre);</code> just before the <code>for</code> loop and see the results. Below are the results after sorting- </p> <pre><code>1726.50146484375 681.5185546875 0.624771118164063 0.456436157226563 1726.50146484375 681.5185546875 1.15629577636719 0.456436157226563 1726.50146484375 681.5185546875 1.7493896484375 0.456436157226563 1726.50146484375 681.5185546875 2.49296569824219 0.456436157226563 1726.50146484375 681.5185546875 2.861083984375 0.456436157226563 1726.50146484375 681.5185546875 3.20767211914063 0.456436157226563 1726.50146484375 681.5185546875 3.44265747070313 0.456436157226563 1726.50146484375 681.5185546875 11.8232574462891 0.456436157226563 1726.50146484375 681.5185546875 12.2711944580078 0.456436157226563 1726.50146484375 681.5185546875 12.3104858398438 0.456436157226563 1726.50146484375 681.5185546875 13.2642059326172 0.456436157226563 1726.50146484375 681.5185546875 13.4784698486328 0.456436157226563 1726.50146484375 681.5185546875 103.224014282227 0.456436157226563 1726.50146484375 681.5185546875 103.868133544922 0.456436157226563 1726.50146484375 681.5185546875 104.103759765625 0.456436157226563 1726.50146484375 681.5185546875 104.71240234375 0.456436157226563 </code></pre> <p>As you can see, the calculation is correct i.e. in the first row <code>0.624771118164063 + 0.456436157226563</code> is <code>1.15629577636719</code> data in the second row and so on.</p> <p>However, there is a jump from <code>3.44265747070313</code> to <code>11.8232574462891</code> at some point. I am not sure why that may be happening happening, but my assumption is that the indexing goes wrong at a certain point. This is resolved using code below</p> <pre><code>@Degre = map {$Degre[$_] + $step[$_]} (0..@step-1); </code></pre> <p>This time the output is much more consistent in the third column-</p> <pre><code>1139.18230471501 192.716943394942 183.715442551381 0.45937396317494 1139.18230471501 192.716943394942 184.174816514556 0.45937396317494 1139.18230471501 192.716943394942 184.634190477731 0.45937396317494 1139.18230471501 192.716943394942 185.093564440906 0.45937396317494 1139.18230471501 192.716943394942 185.552938404081 0.45937396317494 1139.18230471501 192.716943394942 186.012312367256 0.45937396317494 1139.18230471501 192.716943394942 186.471686330431 0.45937396317494 1139.18230471501 192.716943394942 186.931060293605 0.45937396317494 1139.18230471501 192.716943394942 187.39043425678 0.45937396317494 1139.18230471501 192.716943394942 187.849808219955 0.45937396317494 1139.18230471501 192.716943394942 188.30918218313 0.45937396317494 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload