Function: cl-lcm

cl-lcm is an autoloaded and byte-compiled function defined in cl-extra.el.gz.

Signature

(cl-lcm &rest ARGS)

Documentation

Return the least common multiple of the arguments.

View in manual

Aliases

lcm (obsolete since 27.1)

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/cl-extra.el.gz
;;;###autoload
(defun cl-lcm (&rest args)
  "Return the least common multiple of the arguments."
  (declare (side-effect-free t))
  (if (memq 0 args)
      0
    (let ((a (or (pop args) 1)))
      (dolist (b args)
        (setq a (* (/ a (cl-gcd a b)) b)))
      (abs a))))