From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 8GnBAsw202KNxwAAbAwnHQ (envelope-from ) for ; Sun, 17 Jul 2022 00:08:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id +Ia1Asw202KzbwAAauVa8A (envelope-from ) for ; Sun, 17 Jul 2022 00:08:12 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AA3912E147 for ; Sun, 17 Jul 2022 00:08:11 +0200 (CEST) Received: from localhost ([::1]:40330 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oCpxK-0003O4-Qc for larch@yhetil.org; Sat, 16 Jul 2022 18:08:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oCpxD-0003Lw-2l for guix-patches@gnu.org; Sat, 16 Jul 2022 18:08:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48522) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oCpxC-0007Wa-Qc for guix-patches@gnu.org; Sat, 16 Jul 2022 18:08:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oCpxC-0000Jd-JP for guix-patches@gnu.org; Sat, 16 Jul 2022 18:08:02 -0400 Subject: bug#56558: [PATCH] build: Simpler percentage calculation. Resent-From: Csepp Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Sat, 16 Jul 2022 22:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 56558 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Liliana Marie Prikler Cc: Csepp , 56558-close@debbugs.gnu.org Mail-Followup-To: 56558@debbugs.gnu.org, raingloom@riseup.net, raingloom@riseup.net Received: via spool by 56558-done@debbugs.gnu.org id=D56558.16580092301150 (code D ref 56558); Sat, 16 Jul 2022 22:08:02 +0000 Received: (at 56558-close) by debbugs.gnu.org; 16 Jul 2022 22:07:10 +0000 Received: from localhost ([127.0.0.1]:46279 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCpwM-0000IU-7v for submit@debbugs.gnu.org; Sat, 16 Jul 2022 18:07:10 -0400 Received: from mx0.riseup.net ([198.252.153.6]:47040) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCpwH-0000Hy-WE for 56558-close@debbugs.gnu.org; Sat, 16 Jul 2022 18:07:08 -0400 Received: from fews1.riseup.net (fews1-pn.riseup.net [10.0.1.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.riseup.net", Issuer "R3" (not verified)) by mx0.riseup.net (Postfix) with ESMTPS id 4Llj4h0kDZz9s1R; Sat, 16 Jul 2022 22:07:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1658009220; bh=J+PSkVOMcOV3837FdLoK7Z4QEmWVh64PY+zMa1RADUo=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=FQYx/PiH06EDBNKmqSre5B/MXKQlE5GK26owpN52RdoXzGhoaBCjtbCxlLhVyQ/KD 2lDMUGMcfjOp0ACaIglF8rsjy/9XZvnvKTmFrNjoGMwxzJFViCNGHm0TDS4YXde8oC a6wgx1/o1Mmq6IE+CmN2J03ifSTHUxHnIkGuaeuE= X-Riseup-User-ID: 2569688F32A1DF9E7171D89700526BA010F445AE821696DCE699E00D36A40210 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews1.riseup.net (Postfix) with ESMTPSA id 4Llj4g2kXjz5vxk; Sat, 16 Jul 2022 22:06:58 +0000 (UTC) References: <20220714145851.20305-1-raingloom@riseup.net> <4259f9de2b793af8d39647800d6dec0d377f02d5.camel@ist.tugraz.at> <87pmi6ad3v.fsf@riseup.net> From: Csepp Date: Sun, 17 Jul 2022 00:04:34 +0200 In-reply-to: Message-ID: <87pmi490g1.fsf@riseup.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1658009291; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-to: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=J+PSkVOMcOV3837FdLoK7Z4QEmWVh64PY+zMa1RADUo=; b=pCjgarM/T2Vj3mW5+5gMSQ3ZVb0iBc2HfWu0+Hny6+dgCqX6XI+N4IWpk3pd0L1uBW6ZAe Ebi5Z3V1xz7c53yQwBqr2LGAasmDM115qju5PP4C9e+BQmO563BRid1P+i3klSrgJzvxGu z0Smc7OiPyE/MHmtYu63uyVNHvVBCrlZ4h9wdwmxQzHt6oIUuXRkcvBlwtD0Xo5Lw56JiD EwO+m3dl7iQo7dyx/+56VTBfy3YiITwG1H5xB1WU5BbbSf+PqFi9/YQ8wNhAc2xIe34thr dnKgqRYcJrcNAi23V0wFknmJDhT7XQOaJnHxDLoNBDPNrcUGbzo04Tf+cJX4GQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658009291; a=rsa-sha256; cv=none; b=ZsxUdwkfNZtXFM7+ho0EqPBjQdY0R/Zkjnjs4fS+U0U0Sd9CLJy1wQkz0nIWj2iuVceSzi PrVaUeano181lMHPLJUDWHYvB9mlUXtn2SmGz3tgOgftMT22as8S4Lm8Ph6LJn+3p3CEhA Y2wzsgkQeMcu0ApdFkuRsITStSqDldfFSfZeC+VRfKggizs5DttjQSKu/1A7922yMFkCvF /Wq3ZRxqouPtJR8sgMxIwOOCVhJiIOahSVH7l7iGge41EebKne/KCPvvMvZ3uou7MxjD3K A06FvLt3tEvgzK0pyk4N7PDzXYS/sT1ov/1iqGdgvCHRfzVIaUdIU7IpPthmvA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=riseup.net header.s=squak header.b="FQYx/PiH"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=riseup.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 4.76 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=riseup.net header.s=squak header.b="FQYx/PiH"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=riseup.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: AA3912E147 X-Spam-Score: 4.76 X-Migadu-Scanner: scn0.migadu.com X-TUID: ZFAmnNMB5TA8 Liliana Marie Prikler writes: > Am Freitag, dem 15.07.2022 um 12:17 +0200 schrieb Csepp: >>=20 >> Liliana Marie Prikler writes: >>=20 >> > Am Donnerstag, dem 14.07.2022 um 16:58 +0200 schrieb raingloom: >> > > * build-aux/compile-all (%): Simpler calculation that avoids >> > > intermediate float. >> > > --- >> > > =C2=A0build-aux/compile-all.scm | 2 +- >> > > =C2=A01 file changed, 1 insertion(+), 1 deletion(-) >> > >=20 >> > > 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*) >> > > =C2=A0 >> > > =C2=A0(define (% completed total) >> > > =C2=A0=C2=A0 "Return the completion percentage of COMPLETED over TOT= AL as >> > > an >> > > integer." >> > > -=C2=A0 (inexact->exact (round (* 100. (/ completed total))))) >> > > +=C2=A0 (quotient (* 100 completed) total)) >> > I am fairly certain that this changes the semantics of %.=C2=A0 Try for >> > example (% 23 24). >> >=20 >> > Cheers >>=20 >> It rounds down instead of up, which, :shrug:. >> If that's a deal breaker, feel free to close this. > It's not simply "rounding up", you need to round towards the nearest, > which can be done with just quotient and remainder, but is probably > more complicated than the float solution. Yeah, I meant it rounds up in that case. Since it's only used for indicating progress to the user, being off by 1% is not something I'd worry about, but whatevs, I guess we can leave it as is.