dedetive/math-sorter ? reverse-engineered prompt

Reverse engineered prompt

Build me a small Desmos formula set that can take a whole number and do three things, reverse its digits, sort its digits from biggest to smallest, and sort its digits from smallest to biggest.

I want it written in Desmos style syntax, with all the helper expressions needed so it works as a reusable set of functions. Please include clear examples for each one, like what happens with 1512, 9229191, and 314159265, and make sure the ascending version is based on the descending one if that makes sense.

It’s okay if there are known limits, but call them out clearly, especially for decimals, leading zeros, trailing zeros, and very large numbers. Keep it simple enough that I can paste it into Desmos and understand what each part is doing. If you need to check the current Desmos syntax or best practices, look them up online first.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab