This is a part two of a question I asked a few days ago and was answered rather spectacularly by user egreg, which you can find here.
I'm now looking to take part of the LaTeX provided to me, and change the command that generates a list of numbers. I'd like to take the generated list and sort them by ascending order. The code that I have so far to generate the list of numbers is here:
\documentclass[12pt]{article}
\usepackage{xfp}
\ExplSyntaxOn
\NewDocumentCommand{\randomvalues}{m}
{
\int_rand:nn { -40 } { 40 }
\prg_replicate:nn { #1 - 1 } { , :\int_rand:nn { -40 } { 40 } }
}
\ExplSyntaxOff
Currently, it will output a list m number of random and unique integers between -40 and 40, e.g. x = -2, 5, 0, -10, 30; for m=5. I want that list to look like x = -10, -2, 0, 5, 30.

