unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: raingloom <raingloom@riseup.net>
To: 56558@debbugs.gnu.org
Cc: raingloom <raingloom@riseup.net>
Subject: [bug#56558] [PATCH] build: Simpler percentage calculation.
Date: Thu, 14 Jul 2022 16:58:51 +0200	[thread overview]
Message-ID: <20220714145851.20305-1-raingloom@riseup.net> (raw)

* build-aux/compile-all (%): Simpler calculation that avoids intermediate float.
---
 build-aux/compile-all.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build-aux/compile-all.scm b/build-aux/compile-all.scm
index 9ffbce43ad..6fdbe0dea8 100644
--- a/build-aux/compile-all.scm
+++ b/build-aux/compile-all.scm
@@ -89,7 +89,7 @@ (define (parallel-job-count*)
 
 (define (% completed total)
   "Return the completion percentage of COMPLETED over TOTAL as an integer."
-  (inexact->exact (round (* 100. (/ completed total)))))
+  (quotient (* 100 completed) total))
 
 ;; Install a SIGINT handler to give unwind handlers in 'compile-file' an
 ;; opportunity to run upon SIGINT and to remove temporary output files.
-- 
2.37.0





             reply	other threads:[~2022-07-14 15:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-14 14:58 raingloom [this message]
2022-07-15  8:22 ` [bug#56558] [PATCH] build: Simpler percentage calculation Liliana Marie Prikler
2022-07-15 10:17   ` Csepp
2022-07-15 10:27     ` Liliana Marie Prikler
2022-07-16 22:04       ` bug#56558: " Csepp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220714145851.20305-1-raingloom@riseup.net \
    --to=raingloom@riseup.net \
    --cc=56558@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).