(message
"Aligning `%s' (rule %d of %d) %d%%..."
(symbol-name symbol) rule-index rule-count
- (/ (* (- (point) real-beg) 100)
- (- end-mark real-beg)))
+ (floor (* (- (point) real-beg) 100.0)
+ (- end-mark real-beg)))
(message
"Aligning %d%%..."
- (/ (* (- (point) real-beg) 100)
- (- end-mark real-beg))))))
+ (floor (* (- (point) real-beg) 100.0)
+ (- end-mark real-beg))))))
;; if the search ended us on the beginning of
;; the next line, move back to the end of the
(eq semantic-working-type 'percent)
(progress-reporter-update
semantic--progress-reporter
- (/ (* 100 (semantic-lex-token-start (car stream)))
- (point-max))))))
+ (floor (* 100.0 (semantic-lex-token-start (car stream)))
+ (point-max))))))
result))
\f
;;; Parsing Warnings:
semantic--progress-reporter
(progress-reporter-update
semantic--progress-reporter
- (/ (* 100 (semantic-lex-token-start
- (car wisent-lex-istream)))
- (point-max))))))
+ (floor (* 100.0 (semantic-lex-token-start
+ (car wisent-lex-istream)))
+ (point-max))))))
;; Return parse tree
(nreverse ptree)))
\f
(mapcar (lambda (entry)
(prog2
(message "Creating customization items ...%2d%%"
- (/ (* 100.0 count) length))
+ (floor (* 100.0 count) length))
(widget-create (nth 1 entry)
:tag (custom-unlispify-tag-name
(nth 0 entry))
,(let* ((beg (point-min))
(end (point-max))
(total (buffer-size))
- (percent (if (> total 50000) ; Avoid overflow multiplying by 100
- (/ (+ (/ total 200) (1- pos)) (max (/ total 100) 1))
- (/ (+ (/ total 2) (* 100 (1- pos))) (max total 1))))
+ (percent (round (* 100.0 (1- pos)) (max total 1)))
(hscroll (if (= (window-hscroll) 0)
""
(format ", Hscroll: %d" (window-hscroll))))
;; Loop over docstrings.
(while (checkdoc-next-docstring)
(message "Searching for doc string spell error...%d%%"
- (/ (* 100 (point)) (point-max)))
+ (floor (* 100.0 (point)) (point-max)))
(if (looking-at "\"")
(checkdoc-ispell-docstring-engine
(save-excursion (forward-sexp 1) (point-marker)))))
;; Loop over message strings.
(while (checkdoc-message-text-next-string (point-max))
(message "Searching for message string spell error...%d%%"
- (/ (* 100 (point)) (point-max)))
+ (floor (* 100.0 (point)) (point-max)))
(if (looking-at "\"")
(checkdoc-ispell-docstring-engine
(save-excursion (forward-sexp 1) (point-marker)))))
(condition-case nil
(while (and (not msg) (checkdoc-next-docstring))
(message "Searching for doc string error...%d%%"
- (/ (* 100 (point)) (point-max)))
+ (floor (* 100.0 (point)) (point-max)))
(if (setq msg (checkdoc-this-string-valid))
(setq msg (cons msg (point)))))
;; Quit.. restore position, Other errors, leave alone
(setq type
(checkdoc-message-text-next-string (point-max))))
(message "Searching for message string error...%d%%"
- (/ (* 100 (point)) (point-max)))
+ (floor (* 100.0 (point)) (point-max)))
(if (setq msg (checkdoc-message-text-engine type))
(setq msg (cons msg (point)))))
;; Quit.. restore position, Other errors, leave alone
(princ "Methods Primary Only: ")
(prin1 primaryonly)
(princ "\t")
- (princ (format "%d" (* (/ (float primaryonly) (float methidx)) 100)))
+ (princ (format "%d" (floor (* 100.0 primaryonly) methidx)))
(princ "% of total methods")
(terpri)
(princ "Only One Primary Impl: ")
(prin1 oneprimary)
(princ "\t")
- (princ (format "%d" (* (/ (float oneprimary) (float primaryonly)) 100)))
+ (princ (format "%d" (floor (* 100.0 oneprimary) primaryonly)))
(princ "% of total primary methods")
(terpri)
))
(if (= current total)
(message "%s...done" prompt)
(message "%s...%d%%" prompt
- (floor (* (/ current (float total)) 100))))
+ (floor (* 100.0 current) total)))
(message "%s..." prompt))))
(defun epa-read-file-name (input)
(get-buffer (plist-get elt :file))
(+ (buffer-size) 0.0
erc-dcc-byte-count))))
- (concat " ("
- (if (= byte-count 0)
- "0"
- (number-to-string
- (truncate
- (* 100
- (/ byte-count (plist-get elt :size))))))
- "%)"))))
+ (format " (%d%%)"
+ (floor (* 100.0 byte-count)
+ (plist-get elt :size))))))
?f (or (and (plist-member elt :file) (plist-get elt :file)) "")))
(erc-display-message
nil 'notice 'active
(add-text-properties (car ffap-string-at-point-region) (point)
ffap-menu-text-plist)
(message "Scanning...%2d%% <%s>"
- (/ (* 100 (- (point) (point-min))) range) item)))
+ (floor (* 100.0 (- (point) (point-min))) range) item)))
(or mod (restore-buffer-modified-p nil))))
(message "Scanning...done")
;; Remove duplicates.
(when (and (< 0 expected)
(= 0 (mod count 100)))
(message "importing: %d of %d (%.2f%%)"
- count expected (/ (* 100 count) expected)))
+ count expected (/ (* 100.0 count) expected)))
(setq entry (car-safe old)
old (cdr-safe old))
(let* ((id (car-safe entry))
(> number nnmail-large-newsgroup)
(zerop (% (incf count) 20))
(nnheader-message 5 "nnbabyl: Receiving headers... %d%%"
- (/ (* count 100) number))))
+ (floor (* count 100.0) number))))
(and (numberp nnmail-large-newsgroup)
(> number nnmail-large-newsgroup)
(> number nnmail-large-newsgroup)
(zerop (% count 20))
(nnheader-message 6 "nndiary: Receiving headers... %d%%"
- (/ (* count 100) number))))
+ (floor (* count 100.0) number))))
(and (numberp nnmail-large-newsgroup)
(> number nnmail-large-newsgroup)
(and large
(zerop (% count 20))
(nnheader-message 5 "nneething: Receiving headers... %d%%"
- (/ (* count 100) number))))
+ (floor (* count 100.0) number))))
(when large
(nnheader-message 5 "nneething: Receiving headers...done"))
(> number nnmail-large-newsgroup)
(zerop (% count 20))
(nnheader-message 5 "nnmbox: Receiving headers... %d%%"
- (/ (* count 100) number))))
+ (floor (* count 100.0) number))))
(and (numberp nnmail-large-newsgroup)
(> number nnmail-large-newsgroup)
(and large
(zerop (% count 20))
(nnheader-message 5 "nnmh: Receiving headers... %d%%"
- (/ (* count 100) number))))
+ (floor (* count 100.0) number))))
(when large
(nnheader-message 5 "nnmh: Receiving headers...done"))
(> number nnmail-large-newsgroup)
(zerop (% count 20))
(nnheader-message 6 "nnml: Receiving headers... %d%%"
- (/ (* count 100) number))))
+ (floor (* count 100.0) number))))
(and (numberp nnmail-large-newsgroup)
(> number nnmail-large-newsgroup)
(and do-message
(zerop (% (incf count) 20))
(nnheader-message 5 "nnspool: Receiving headers... %d%%"
- (/ (* count 100) number))))
+ (floor (* count 100.0) number))))
(when do-message
(nnheader-message 5 "nnspool: Receiving headers...done"))
(> number nntp-large-newsgroup)
(zerop (% received 20))
(nnheader-message 6 "NNTP: Receiving headers... %d%%"
- (/ (* received 100) number)))
+ (floor (* received 100.0) number)))
(nntp-accept-response))))
(and (numberp nntp-large-newsgroup)
(> number nntp-large-newsgroup)
(> number nntp-large-newsgroup)
(zerop (% received 20))
(nnheader-message 6 "NNTP: Receiving articles... %d%%"
- (/ (* received 100) number)))
+ (floor (* received 100.0) number)))
(nntp-accept-response))))
(and (numberp nntp-large-newsgroup)
(> number nntp-large-newsgroup)
(when (and (< 0 expected)
(= 0 (mod count 1000)))
(message "reindexing: %d of %d (%.2f%%)"
- count expected (/ (* 100 count) expected)))
+ count expected (/ (* 100.0 count) expected)))
(dolist (val (cdr-safe (assq tr v)))
(let* ((value-keys (registry-lookup-secondary-value db tr val)))
(push key value-keys)
(let ((pos (point))
(total (buffer-size)))
(and reverse (setq pos (- total pos)))
- (if (> total 50000)
- ;; Avoid overflow from multiplying by 100!
- (/ (1- pos) (max (/ total 100) 1))
- (/ (* 100 (1- pos)) (max total 1)))))
+ (floor (* 100.0 (1- pos)) (max total 1))))
(defun imenu--split (list n)
"Split LIST into sublists of max length N.
(cons (cons kana candidates) skkdic-okuri-nasi-entries)
skkdic-okuri-nasi-entries-count
(1+ skkdic-okuri-nasi-entries-count))
- (setq ratio (floor (/ (* (point) 100.0) (point-max))))
+ (setq ratio (floor (* (point) 100.0) (point-max)))
(if (/= (/ prev-ratio 10) (/ ratio 10))
(progn
(message "collected %2d%% ..." ratio)
(while l
(let ((kana (car (car l)))
(candidates (cdr (car l))))
- (setq ratio (/ (* count 100) skkdic-okuri-nasi-entries-count)
+ (setq ratio (floor (* count 100.0) skkdic-okuri-nasi-entries-count)
count (1+ count))
(if (/= (/ prev-ratio 10) (/ ratio 10))
(progn
-6)))
(if (zerop ange-ftp-xfer-size)
(ange-ftp-message "%s...%dk" ange-ftp-process-msg kbytes)
- (let ((percent (/ (* 100 kbytes) ange-ftp-xfer-size)))
+ (let ((percent (floor (* 100.0 kbytes) ange-ftp-xfer-size)))
;; cut out the redisplay of identical %-age messages.
(unless (eq percent ange-ftp-last-percent)
(setq ange-ftp-last-percent percent)
(defun rng-compute-mode-line-string ()
(cond (rng-validate-timer
- (concat " Validated:"
- (number-to-string
- ;; Use floor rather than round because we want
- ;; to show 99% rather than 100% for changes near
- ;; the end.
- (floor (if (eq (buffer-size) 0)
- 0.0
- (/ (* (- rng-validate-up-to-date-end (point-min))
- 100.0)
- (- (point-max) (point-min))))))
- "%%"))
+ (format " Validated:%d%%"
+ (if (= 0 (buffer-size))
+ 0
+ (floor (- rng-validate-up-to-date-end (point-min))
+ (- (point-max) (point-min))))))
((> rng-error-count 0)
(concat " "
(propertize "Invalid"
(defun org-nofm-to-completion (n m &optional percent)
(if (not percent)
(format "[%d/%d]" n m)
- (format "[%d%%]"(floor (+ 0.5 (* 100. (/ (* 1.0 n) m)))))))
+ (format "[%d%%]" (round (* 100.0 n) m))))
(defun org-columns-string-to-number (s fmt)
(checked (car (nth 3 cookie)))
(total (cdr (nth 3 cookie)))
(new (if percentp
- (format "[%d%%]" (/ (* 100 checked)
- (max 1 total)))
+ (format "[%d%%]" (floor (* 100.0 checked)
+ (max 1 total)))
(format "[%d/%d]" checked total))))
(goto-char beg)
(insert new)
(goto-char (point-min))
(while (re-search-forward org-table-any-line-regexp nil t)
(unless quietly
- (message "Mapping tables: %d%%" (/ (* 100.0 (point)) (buffer-size))))
+ (message "Mapping tables: %d%%"
+ (floor (* 100.0 (point)) (buffer-size))))
(beginning-of-line 1)
(when (and (looking-at org-table-line-regexp)
;; Exclude tables in src/example/verbatim/clocktable blocks
(outline-next-heading)))
(setq new
(if is-percent
- (format "[%d%%]" (/ (* 100 cnt-done) (max 1 cnt-all)))
+ (format "[%d%%]" (floor (* 100.0 cnt-done)
+ (max 1 cnt-all)))
(format "[%d/%d]" cnt-done cnt-all))
ndel (- (match-end 0) checkbox-beg))
;; handle overlays when updating cookie from column view
(insert (caar temp-list)
(format "%4d%3d%% "
(cl-cadar temp-list)
- (/ (* 100 (cl-cadar temp-list)) total)))
+ (floor (* 100.0 (cl-cadar temp-list)) total)))
(setq temp-list (nthcdr 4 temp-list)))
(insert ?\n)
(setq freq-list (cdr freq-list)
": A B C D E F G H I J K L M N O P Q R S T U V W X Y Z *"
(format "%4d %4d %3d%%\n "
(cl-third entry) (cl-second entry)
- (/ (* 100 (cl-second entry)) total-chars))
+ (floor (* 100.0 (cl-second entry)) total-chars))
(decipher--digram-counts (aref decipher--after i)) ?\n))))
(setq buffer-read-only t)
(set-buffer-modified-p nil)
(format "%s" object))))
(defun profiler-format-percent (number divisor)
- (concat (number-to-string (/ (* number 100) divisor)) "%"))
+ (format "%d%%" (floor (* 100.0 number) divisor)))
(defun profiler-format-number (number)
"Format NUMBER in human readable string."
(c-save-buffer-state
(beginning-of-defun-function end-of-defun-function
where pos name-end case-fold-search)
-
+
(save-restriction
(widen)
(save-excursion
(if (< c-progress-interval (- now lastsecs))
(progn
(message "Indenting region... (%d%% complete)"
- (/ (* 100 (- (point) start)) (- end start)))
+ (floor (* 100.0 (- (point) start)) (- end start)))
(aset c-progress-info 2 now)))
)))
(cpp-progress-message "Parsing...")
(while (re-search-forward cpp-parse-regexp nil t)
(cpp-progress-message "Parsing...%d%%"
- (/ (* 100 (- (point) (point-min))) (buffer-size)))
+ (floor (* 100.0 (- (point) (point-min)))
+ (buffer-size)))
(let ((match (buffer-substring (match-beginning 0) (match-end 0))))
(cond ((or (string-equal match "'")
(string-equal match "\""))
props (car (cdr elem)))
(if (= (mod elem-cnt msg-cnt) 0)
(message "Converting XML routine info...%2d%%"
- (/ (* elem-cnt 100) nelem)))
+ (floor (* elem-cnt 100.0) nelem)))
(cond
((eq type 'ROUTINE)
(if (setq alias (assq 'alias_to props))
(erase-buffer)
(while (setq routine (pop routines))
(if (= (mod (setq n (1+ n)) step) 0)
- (message "Compiling list...(%2d%%)" (/ (* n 100) nroutines)))
+ (message "Compiling list...(%2d%%)" (floor (* n 100.0) nroutines)))
;; Get a list of all twins
(setq twins (idlwave-routine-twins routine (or lroutines routines)))
;; Report the percentage complete.
(setq opascal-progress-last-reported-point p)
(message "%s %s ... %d%%"
- desc (buffer-name) (/ (* 100 p) (point-max))))))
+ desc (buffer-name) (floor (* 100.0 p) (point-max))))))
(defun opascal-next-line-start (&optional from-point)
;; Returns the first point of the next line.
(- (nth 1 (current-time)) (aref vhdl-progress-info 2))))
(let ((delta (- (aref vhdl-progress-info 1)
(aref vhdl-progress-info 0))))
- (if (= 0 delta)
- (message (concat string "... (100%s)") "%")
- (message (concat string "... (%2d%s)")
- (/ (* 100 (- pos (aref vhdl-progress-info 0)))
- delta) "%")))
+ (message "%s... (%2d%%)" string
+ (if (= 0 delta)
+ 100
+ (floor (* 100.0 (- pos (aref vhdl-progress-info 0)))
+ delta))))
(aset vhdl-progress-info 2 (nth 1 (current-time)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; do for all files
(while file-list
(unless noninteractive
- (message "Scanning %s %s\"%s\"... (%2d%s)"
+ (message "Scanning %s %s\"%s\"... (%2d%%)"
(if is-directory "directory" "files")
(or num-string "") name
- (/ (* 100 (- no-files (length file-list))) no-files) "%"))
+ (floor (* 100.0 (- no-files (length file-list))) no-files)))
(let ((file-name (abbreviate-file-name (car file-list)))
ent-list arch-list arch-ent-list conf-list
pack-list pack-body-list inst-list inst-ent-list)
(progn
(setq ps-razchunk q-done)
(message "Formatting...%3d%%"
- (if (< q-todo 100)
- (/ (* 100 q-done) q-todo)
- (/ q-done (/ q-todo 100)))
- ))))))
+ (floor (* 100.0 q-done) q-todo)))))))
(defvar ps-last-font nil)
(end (point-max))
(pos (point))
(total (buffer-size))
- (percent (if (> total 50000)
- ;; Avoid overflow from multiplying by 100!
- (/ (+ (/ total 200) (1- pos)) (max (/ total 100) 1))
- (/ (+ (/ total 2) (* 100 (1- pos))) (max total 1))))
+ (percent (round (* 100.0 (1- pos)) (max 1 total)))
(hscroll (if (= (window-hscroll) 0)
""
(format " Hscroll=%d" (window-hscroll))))
(let* ((size (- (point-max) (point-min)))
(perc (if (= size 0)
100
- (/ (* 100 (- (point) (point-min))) size))))
+ (floor (* 100.0 (- (point) (point-min))) size))))
(when (>= perc (+ bibtex-progress-lastperc
bibtex-progress-interval))
(setq bibtex-progress-lastperc perc)
(if (and flyspell-issue-message-flag (= count 100))
(progn
(message "Spell Checking...%d%%"
- (* 100 (/ (float (- (point) beg)) (- end beg))))
+ (floor (* 100.0 (- (point) beg)) (- end beg)))
(setq count 0))
(setq count (+ 1 count)))
(flyspell-word)
;; be unnecessary too. -- rms.
(if flyspell-issue-message-flag
(message "Spell Checking...%d%% [%s]"
- (* 100 (/ (float (point)) (point-max)))
+ (floor (* 100.0 (point)) (point-max))
word))
(with-current-buffer flyspell-large-region-buffer
(goto-char buffer-scan-pos)
(while (and (re-search-forward border3 (point-max) t)
(not (and (input-pending-p)
table-abort-recognition-when-input-pending)))
- (message "Recognizing tables...(%d%%)" (/ (* 100 (match-beginning 0)) (- (point-max) (point-min))))
+ (message "Recognizing tables...(%d%%)"
+ (floor (* 100.0 (match-beginning 0))
+ (- (point-max) (point-min))))
(let ((beg (match-beginning 0))
end)
(if (re-search-forward non-border (point-max) t)