Skip to content

Commit 2ca2e4c

Browse files
0382jvdp1
andauthored
Apply suggestions from code review
Co-authored-by: Jeremie Vandenplas <[email protected]>
1 parent 4931ecb commit 2ca2e4c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

doc/specs/stdlib_sorting.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,13 @@ low, being of order O(Ln(N)), while the memory requirements of
201201
#### The `RADIX_SORT` subroutine
202202

203203
`RADIX_SORT` is a implementation of LSD [radix sort](https://en.wikipedia.org/wiki/Radix_sort),
204-
using `256` (one byte) as the radix. It only works for fixed width data,
204+
using `256` as the radix. It only works for fixed width data,
205205
thus integers and reals. `RADIX_SORT` is always of O(N) runtime performance
206206
for any input data. For large and random data, it is about five (or more)
207207
times faster than other sort subroutines.
208208

209209
The `RADIX_SORT` needs a buffer that have same size of the input data.
210-
Your can provide it using `work` arguement, if not the subroutine will
210+
Your can provide it using `work` argument, if not the subroutine will
211211
allocate the buffer and deallocate before return.
212212

213213
### Specifications of the `stdlib_sorting` procedures
@@ -362,17 +362,17 @@ input elements will be sorted in order of non-decreasing value.
362362
array, and shall have at least `size(array)` elements. It is an
363363
`intent(inout)` argument, and its contents on return are undefined.
364364

365-
`reverse` (optional): shall be a scalar of type default logical. It
365+
`reverse` (optional): shall be a scalar of type default `logical`. It
366366
is an `intent(in)` argument. If present with a value of `.true.` then
367367
`array` will be sorted in order of non-increasing values in unstable
368368
order. Otherwise index will sort `array` in order of non-decreasing
369369
values in unstable order.
370370

371371
##### Notes
372372

373-
`SORT` implements a LSD radix sort algorithm with a `256` radix. For any
373+
`radix_sort` implements a LSD radix sort algorithm with a `256` radix. For any
374374
input data it provides `O(N)` run time performance. If `array` is of
375-
any type `REAL` the order of its elements on return undefined if any
375+
any type `real` the order of its elements on return undefined if any
376376
element of `array` is a `NaN`.
377377

378378
##### Example

example/sorting/example_radix_sort.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ program example_radix_sort
2020
arrf64 = [1.0_dp/x, 0.0_dp, 0.0_dp/x, -1.0_dp/x, -0.0_dp, 1.0_dp, -1.0_dp, 3.45_dp, -3.14_dp, 3.44_dp]
2121
call radix_sort(arrf64)
2222
print *, arrf64
23-
! Expect output:
23+
! Expected output:
2424
! nan, -inf, -3.14, -1.0, -0.0, 0.0, 1.0, 3.44, 3.45, inf
2525
! Note: the position of nan is undefined
2626
end program example_radix_sort

0 commit comments

Comments
 (0)