Talk:Reduced row echelon form: Difference between revisions

From Rosetta Code
Content added Content deleted
(New page: =="Break" vs. "return" bug== The original author of the Python example mistakenly translated the keyword <code>stop</code> that appears in the [http://en.wikipedia.org/wiki/Row_echelon_fo...)
 
(compare current output.)
Line 10: Line 10:
</pre>
</pre>
I noticed and fixed the bug a couple of days ago, but it seems that several of the other examples written before then (being, by and large, translations from the Python) copied the bug. Hence, I've marked all the examples that looked like they might have this bug with the needs-review template. Note that I erred on the side of false positives. That is, I'm pretty sure the examples I ''didn't'' mark are bug-free, but some of the ones I did mark may be fine. &mdash;[[User:Underscore|Underscore]] 00:25, 5 May 2009 (UTC)
I noticed and fixed the bug a couple of days ago, but it seems that several of the other examples written before then (being, by and large, translations from the Python) copied the bug. Hence, I've marked all the examples that looked like they might have this bug with the needs-review template. Note that I erred on the side of false positives. That is, I'm pretty sure the examples I ''didn't'' mark are bug-free, but some of the ones I did mark may be fine. &mdash;[[User:Underscore|Underscore]] 00:25, 5 May 2009 (UTC)

I ran the ALGOL 68 version and got:
(( 1.0000, 2.0000, 0.0000, 0.0000, 3.0000, 4.0000),
( 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, -1.0000),
( 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000),
( 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000),
( 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000))
Vs the current python version which got:
1, 2, 0, 0, 3, 4
0, 0, 1, 0, 0, -1
0, 0, 0, 1, 0, 0
0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0
It looks like - currently- they are both getting the same answer... next step is it to get out a pencil.

[[User:NevilleDNZ|NevilleDNZ]] 01:46, 5 May 2009 (UTC)

Revision as of 01:46, 5 May 2009

"Break" vs. "return" bug

The original author of the Python example mistakenly translated the keyword stop that appears in the Wikipedia pseudocode as break rather than the correct return. This created a control-flow bug that didn't manifest itself when the program was run on the example matrix given in the task description, but did cause an exception if the program was run on, e.g.,

 1  2  3  4  3  1
 2  4  6  2  6  2
 3  6 18  9  9 -6
 4  8 12 10 12  4
 5 10 24 11 15 -4

I noticed and fixed the bug a couple of days ago, but it seems that several of the other examples written before then (being, by and large, translations from the Python) copied the bug. Hence, I've marked all the examples that looked like they might have this bug with the needs-review template. Note that I erred on the side of false positives. That is, I'm pretty sure the examples I didn't mark are bug-free, but some of the ones I did mark may be fine. —Underscore 00:25, 5 May 2009 (UTC)

I ran the ALGOL 68 version and got:

(( 1.0000,  2.0000,  0.0000,  0.0000,  3.0000,  4.0000), 
 ( 0.0000,  0.0000,  1.0000,  0.0000,  0.0000, -1.0000), 
 ( 0.0000,  0.0000,  0.0000,  1.0000,  0.0000,  0.0000), 
 ( 0.0000,  0.0000,  0.0000,  0.0000,  0.0000,  0.0000), 
 ( 0.0000,  0.0000,  0.0000,  0.0000,  0.0000,  0.0000))

Vs the current python version which got:

1, 2, 0, 0, 3, 4
0, 0, 1, 0, 0, -1
0, 0, 0, 1, 0, 0
0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0

It looks like - currently- they are both getting the same answer... next step is it to get out a pencil.

NevilleDNZ 01:46, 5 May 2009 (UTC)