# [`>`](https://bpl.fast.ai//glyphs/greater-than.html) — Sort down / Greater

Function. Hanzi: `大`. Ranks: [`∞`](https://bpl.fast.ai//glyphs/infinity.html) monadic, `0 0` dyadic

`>Y` sorts the major cells of `Y` descending, as `[⍒Y]⌷Y` does. Ties keep their order.

```bpl
>30 10 20           ⍝ 30 20 10
>"b" "a" "c"        ⍝ "c" "b" "a"
```

`X>Y` tests X \> Y for reals, and for characters by code point. A number is less than any character, as [`⍋`](delta-stile.md) orders them. Pervasive; [tolerant](../evaluation.md#equality-and-ordering).

```bpl
1 2 3>2            ⍝ $f $f $t
"abd">"abc"        ⍝ $f $f $t
'a'>3              ⍝ $t
```

See [`<`](less-than.md) to sort up, and [`⍒`](del-stile.md) for the positions that sort.

## Fast combinations

BPL computes each of these combinations with a dedicated algorithm. [Trains](../evaluation.md#trains) says which spellings BPL recognises.

| Combination | Applies to | Benefit |
|--- |--- |--- |
| `k↑>Y`, `k↑> Y` or `(k↑)∘>` | a vector of reals or characters without keys | selects the `k` largest items, or the `-k` smallest, without ordering the rest |
| `↑>Y`, `i⌷>Y` or `i⊃>Y` | the same vectors | selects the item of rank `i` from the top without ordering the rest |

```bpl
v←30 10 20 50 40 60 70 80 90 0
2↑> v                               ⍝ 90 80
↑> v                                ⍝ 90
(•explain "↑> v").fast.rule         ⍝ ["partial sort"]
```
