From: Csepp <raingloom@riseup.net>
To: Liliana Marie Prikler <liliana.prikler@ist.tugraz.at>
Cc: 56558@debbugs.gnu.org, raingloom <raingloom@riseup.net>
Subject: [bug#56558] [PATCH] build: Simpler percentage calculation.
Date: Fri, 15 Jul 2022 12:17:30 +0200 [thread overview]
Message-ID: <87pmi6ad3v.fsf@riseup.net> (raw)
In-Reply-To: <4259f9de2b793af8d39647800d6dec0d377f02d5.camel@ist.tugraz.at>
Liliana Marie Prikler <liliana.prikler@ist.tugraz.at> writes:
> Am Donnerstag, dem 14.07.2022 um 16:58 +0200 schrieb raingloom:
>> * 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))
> I am fairly certain that this changes the semantics of %. Try for
> example (% 23 24).
>
> Cheers
It rounds down instead of up, which, :shrug:.
If that's a deal breaker, feel free to close this.
next prev parent reply other threads:[~2022-07-15 10:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-14 14:58 [bug#56558] [PATCH] build: Simpler percentage calculation raingloom
2022-07-15 8:22 ` Liliana Marie Prikler
2022-07-15 10:17 ` Csepp [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pmi6ad3v.fsf@riseup.net \
--to=raingloom@riseup.net \
--cc=56558@debbugs.gnu.org \
--cc=liliana.prikler@ist.tugraz.at \
/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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.