Function: rst-arabic-to-roman

rst-arabic-to-roman is a byte-compiled function defined in rst.el.gz.

Signature

(rst-arabic-to-roman NUM)

Documentation

Convert Arabic number NUM to its Roman numeral representation.

Obviously, NUM must be greater than zero. Don't blame me, blame the Romans, I mean "what have the Romans ever _done_ for /us/?" (with apologies to Monty Python).

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/rst.el.gz
(defun rst-arabic-to-roman (num)
  ;; testcover: ok.
  "Convert Arabic number NUM to its Roman numeral representation.

Obviously, NUM must be greater than zero.  Don't blame me, blame the
Romans, I mean \"what have the Romans ever _done_ for /us/?\" (with
apologies to Monty Python)."
  (cl-check-type num (integer 1 *))
  (let ((map rst-arabic-to-roman)
        (r ""))
    (while (and map (> num 0))
      (cl-destructuring-bind ((val &rest sym) &rest next) map
	(if (>= num val)
	    (setq r (concat r sym)
		  num (- num val))
	  (setq map next))))
    r))