Sorting algorithms/Insertion sort: Difference between revisions
Content added Content deleted
m (→{{header|Fortran}}: classic mistake with non-short-circuit logical operators) |
|||
Line 1,157: | Line 1,157: | ||
=={{header|Fortran}}== |
=={{header|Fortran}}== |
||
{{incorrect|Fortran|The .AND. operator is not "short-circuit", hence the test "a(j)>temp" may crash the program}} |
|||
{{works with|Fortran|90 and later}} |
{{works with|Fortran|90 and later}} |
||
<lang fortran>PURE SUBROUTINE Insertion_Sort(a) |
<lang fortran>PURE SUBROUTINE Insertion_Sort(a) |
||
Line 1,183: | Line 1,184: | ||
=== Alternate Fortran 77 version === |
=== Alternate Fortran 77 version === |
||
{{incorrect|Fortran|The .AND. operator is not "short-circuit", hence the test "A(J).LE.X" may crash the program}} |
|||
<lang fortran> SUBROUTINE SORT(N,A) |
<lang fortran> SUBROUTINE SORT(N,A) |
||
IMPLICIT NONE |
IMPLICIT NONE |