This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
toRoman←{
⍝ Digits and corresponding values
ds←((⊢≠⊃)⊆⊢)' M CM D CD C XC L XL X IX V IV I'
vs←1000,,100101∘.×9541
⍝ Input ≤ 0 is invalid
⍵≤0:⎕SIGNAL11
{0=d←⊃⍸vs≤⍵:⍬⍝ Find highest digit in number
(d⊃ds),∇⍵-d⊃vs⍝ While one exists, add it and subtract from number