Function: hypb:oct-to-int

hypb:oct-to-int is a byte-compiled function defined in hypb.el.

Signature

(hypb:oct-to-int OCT-NUM)

Documentation

Return octal integer OCT-NUM converted to a decimal integer.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hypb.el
(defun hypb:oct-to-int (oct-num)
  "Return octal integer OCT-NUM converted to a decimal integer."
  (let ((oct-str (int-to-string oct-num))
	(dec-num 0))
    (and (string-match "[^0-7]" oct-str)
	 (error "(hypb:oct-to-int): Bad octal number: %s" oct-str))
    (mapc (lambda (o)
	    (setq dec-num (+ (* dec-num 8)
			     (when (and (>= o ?0) (<= o ?7))
			       (- o ?0)))))
	  oct-str)
    dec-num))