From unknown Fri Aug 15 20:52:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc) Resent-From: "Roland Winkler" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Jan 2012 05:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 10554 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 10554@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.13269507729519 (code B ref -1); Thu, 19 Jan 2012 05:27:02 +0000 Received: (at submit) by debbugs.gnu.org; 19 Jan 2012 05:26:12 +0000 Received: from localhost ([127.0.0.1]:35042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RnkVj-0002TL-4N for submit@debbugs.gnu.org; Thu, 19 Jan 2012 00:26:11 -0500 Received: from eggs.gnu.org ([140.186.70.92]:53250) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RnkVf-0002TB-Lz for submit@debbugs.gnu.org; Thu, 19 Jan 2012 00:26:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RnkUX-00031I-9K for submit@debbugs.gnu.org; Thu, 19 Jan 2012 00:24:54 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([140.186.70.17]:44056) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnkUX-00031E-7v for submit@debbugs.gnu.org; Thu, 19 Jan 2012 00:24:53 -0500 Received: from eggs.gnu.org ([140.186.70.92]:42529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnkUW-0004zL-Fh for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2012 00:24:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RnkUV-000314-Gy for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2012 00:24:52 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:50166) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnkUV-000310-EI for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2012 00:24:51 -0500 Received: from 82.red-80-32-229.staticip.rima-tde.net ([80.32.229.82]:47350 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1RnkUU-0000ZC-UF for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2012 00:24:51 -0500 Date: Wed, 18 Jan 2012 23:24:41 -0600 Message-Id: <8762g8i7s6.fsf@niu.edu> From: "Roland Winkler" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -3.4 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) In Calc type 'e T m^2 / hbar Convert this to SI units with u c si RET - That's perfect. We get a dimensionless number. Let's try again. In Calc type (more my range of numbers) 'e T nm^2 / hbar Now when we type again u c, Calc remembers what we did before. So as a unit it offers "default 1". Let's take this default. So just type RET Error: No units specified In other words: if an expression with units simplifies to a dimensionless number, Calc does not accept the unit "1", though it even offers this unit as a default for calc-convert-units. In GNU Emacs 24.0.92.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.20.1) of 2011-12-14 on regnitz Windowing system distributor `The X.Org Foundation', version 11.0.10706000 From unknown Fri Aug 15 20:52:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc) Resent-From: Jay Belanger Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Jan 2012 21:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10554 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "Roland Winkler" Cc: 10554@debbugs.gnu.org, jay.p.belanger@gmail.com Reply-To: jay.p.belanger@gmail.com Received: via spool by 10554-submit@debbugs.gnu.org id=B10554.132700963621675 (code B ref 10554); Thu, 19 Jan 2012 21:48:02 +0000 Received: (at 10554) by debbugs.gnu.org; 19 Jan 2012 21:47:16 +0000 Received: from localhost ([127.0.0.1]:35755 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RnzpE-0005dV-Be for submit@debbugs.gnu.org; Thu, 19 Jan 2012 16:47:16 -0500 Received: from mail.truman.edu ([150.243.162.204]:34361 helo=uranium.truman.edu) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RnzpB-0005dE-Sw for 10554@debbugs.gnu.org; Thu, 19 Jan 2012 16:47:14 -0500 Received: from belanger-office (vh213601.truman.edu [150.243.162.59]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by uranium.truman.edu (Postfix) with ESMTPS id D8F1F12827F; Thu, 19 Jan 2012 15:45:54 -0600 (CST) From: Jay Belanger References: <8762g8i7s6.fsf@niu.edu> Date: Thu, 19 Jan 2012 15:45:55 -0600 In-Reply-To: <8762g8i7s6.fsf@niu.edu> (Roland Winkler's message of "Wed, 18 Jan 2012 23:24:41 -0600") Message-ID: <87bopz5pt8.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.1 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.1 (-) > In Calc type ... > Convert this to SI units with u c si RET > - That's perfect. We get a dimensionless number. ... > Now when we type again u c, Calc remembers what we did before. > So as a unit it offers "default 1". Calc should probably offer "si" as the default in this case. > Let's take this default. > So just type RET > > Error: No units specified > > In other words: if an expression with units simplifies to a > dimensionless number, Calc does not accept the unit "1", though it > even offers this unit as a default for calc-convert-units. Calc shouldn't offer "1" as a default; I'll fix it so that it doesn't do that anymore. I'll also change it so that Calc can offer unit systems and composite units as default units, but that should probably wait until after 24.1 comes out. Jay From unknown Fri Aug 15 20:52:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc) Resent-From: "Roland Winkler" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Jan 2012 22:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10554 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: jay.p.belanger@gmail.com Cc: 10554@debbugs.gnu.org Received: via spool by 10554-submit@debbugs.gnu.org id=B10554.132701250726668 (code B ref 10554); Thu, 19 Jan 2012 22:36:01 +0000 Received: (at 10554) by debbugs.gnu.org; 19 Jan 2012 22:35:07 +0000 Received: from localhost ([127.0.0.1]:35805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ro0ZX-0006w4-15 for submit@debbugs.gnu.org; Thu, 19 Jan 2012 17:35:07 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:37930) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ro0ZV-0006vy-Ft for 10554@debbugs.gnu.org; Thu, 19 Jan 2012 17:35:06 -0500 Received: from [83.175.202.27] (port=54491 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Ro0YH-0007XC-Ht; Thu, 19 Jan 2012 17:33:51 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20248.39483.716850.185512@gargle.gargle.HOWL> Date: Thu, 19 Jan 2012 16:33:31 -0600 From: "Roland Winkler" In-Reply-To: <87bopz5pt8.fsf@gmail.com> References: <8762g8i7s6.fsf@niu.edu> <87bopz5pt8.fsf@gmail.com> X-Mailer: VM 8.2 trial under 24.0.92.1 (x86_64-unknown-linux-gnu) X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) On Thu Jan 19 2012 Jay Belanger wrote: > > > In Calc type > ... > > Convert this to SI units with u c si RET > > - That's perfect. We get a dimensionless number. > ... > > Now when we type again u c, Calc remembers what we did before. > > So as a unit it offers "default 1". > > Calc should probably offer "si" as the default in this case. Yes: If previously one explicitly used "si" as an arg to calc-convert-units, then it would be reasonable if calc-convert-units remembered this choice, independent of the actual SI unit that calc-convert-units obtained at the end of the previous calculation. > I'll also change it so that Calc can offer unit systems and composite > units as default units, but that should probably wait until after 24.1 > comes out. Agreed. This is nothing urgent. >From a different perspective, I'd say that "dimensionless" is as valid a unit as "kg" or "hbar / c". In that sense I'd say that there should be a possibility to pass this unit "dimensionless" as an arg to calc-convert-units, similar to any other unit that this function should use for its final result. I'd say that "1" appears to be a natural choice in order to express the fact that Calc should obtain a dimensionless number. Or is there some other recommended way to do this that I have overlooked? Roland From unknown Fri Aug 15 20:52:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc) Resent-From: Jay Belanger Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jan 2012 04:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10554 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "Roland Winkler" Cc: 10554@debbugs.gnu.org, jay.p.belanger@gmail.com Reply-To: jay.p.belanger@gmail.com Received: via spool by 10554-submit@debbugs.gnu.org id=B10554.13270352673352 (code B ref 10554); Fri, 20 Jan 2012 04:55:01 +0000 Received: (at 10554) by debbugs.gnu.org; 20 Jan 2012 04:54:27 +0000 Received: from localhost ([127.0.0.1]:35954 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ro6Uc-0000s0-Dj for submit@debbugs.gnu.org; Thu, 19 Jan 2012 23:54:27 -0500 Received: from mail-tul01m020-f172.google.com ([209.85.214.172]:46324) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ro6Ua-0000rq-6s for 10554@debbugs.gnu.org; Thu, 19 Jan 2012 23:54:25 -0500 Received: by obbwc12 with SMTP id wc12so235625obb.3 for <10554@debbugs.gnu.org>; Thu, 19 Jan 2012 20:53:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:reply-to:cc:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=1wZqYwCBLOAxk3jAHqNXah8QH27IMjyRNub6WmQscPA=; b=ap2P7PGAoGLKQEgzWCiaTHdvFfhgyRpgPikDm9XQUFY9d5G5p84/TPQHQltggw9orc sH47b/csSrwQ8a4n7tGLCBc/z/g0xuimRiagGAKnKSA5EbW3AS0Knq9dJClaPhE8EDus fNk7JA2b2XXl2tQMYbiRaGxrlzvYGkhnWDO8c= Received: by 10.182.187.37 with SMTP id fp5mr25304488obc.21.1327035188340; Thu, 19 Jan 2012 20:53:08 -0800 (PST) Received: from belanger-x100e (184-155-95-203.cpe.cableone.net. [184.155.95.203]) by mx.google.com with ESMTPS id s6sm1157033obq.0.2012.01.19.20.53.06 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 Jan 2012 20:53:07 -0800 (PST) From: Jay Belanger References: <8762g8i7s6.fsf@niu.edu> <87bopz5pt8.fsf@gmail.com> <20248.39483.716850.185512@gargle.gargle.HOWL> Date: Thu, 19 Jan 2012 22:53:04 -0600 In-Reply-To: <20248.39483.716850.185512@gargle.gargle.HOWL> (Roland Winkler's message of "Thu, 19 Jan 2012 16:33:31 -0600") Message-ID: <87d3afdlfz.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) >> I'll also change it so that Calc can offer unit systems and composite >> units as default units, but that should probably wait until after 24.1 >> comes out. > > Agreed. This is nothing urgent. Good; then this part will be taken care of as soon as 24.1 comes out. >>>From a different perspective, I'd say that "dimensionless" is as > valid a unit as "kg" or "hbar / c". In that sense I'd say that there > should be a possibility to pass this unit "dimensionless" as an arg > to calc-convert-units, similar to any other unit that this function > should use for its final result. Currently, if Calc is asked to convert part of a units expression, it will leave any unrequested units unchanged; for example, if 45 mi/hr is on the stack and the units conversion is called with new units m, then only the mi will be changed; 45 mi/hr will be converted to 72420.48 m / hr. To be consistent, I would think that converting to new units 1, all of the units in the stack expression would be left alone. > I'd say that "1" appears to be a natural choice in order to express > the fact that Calc should obtain a dimensionless number. I suppose you mean /try/ to obtain a dimensionless number. Calc could have a command that will convert an expression to a dimensionless number, if possible, or leave it unchanged, if it cannot be converted to a dimensionless number. I'm not sure that "u c" should do such branching, but then I'm not sure this behavior is what you meant. Jay From unknown Fri Aug 15 20:52:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc) Resent-From: "Roland Winkler" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jan 2012 08:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10554 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: jay.p.belanger@gmail.com Cc: 10554@debbugs.gnu.org Received: via spool by 10554-submit@debbugs.gnu.org id=B10554.132704855026897 (code B ref 10554); Fri, 20 Jan 2012 08:36:02 +0000 Received: (at 10554) by debbugs.gnu.org; 20 Jan 2012 08:35:50 +0000 Received: from localhost ([127.0.0.1]:36125 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ro9ws-0006zl-Bp for submit@debbugs.gnu.org; Fri, 20 Jan 2012 03:35:50 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:46315) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ro9wq-0006zc-6M for 10554@debbugs.gnu.org; Fri, 20 Jan 2012 03:35:49 -0500 Received: from u010774.lc.ehu.es ([158.227.8.163]:35384 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Ro9va-0004gd-Pt; Fri, 20 Jan 2012 03:34:31 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20249.10002.733142.491623@gargle.gargle.HOWL> Date: Fri, 20 Jan 2012 02:34:26 -0600 From: "Roland Winkler" In-Reply-To: <87d3afdlfz.fsf@gmail.com> References: <8762g8i7s6.fsf@niu.edu> <87bopz5pt8.fsf@gmail.com> <20248.39483.716850.185512@gargle.gargle.HOWL> <87d3afdlfz.fsf@gmail.com> X-Mailer: VM 8.2 trial under 24.0.92.1 (x86_64-unknown-linux-gnu) X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) On Thu Jan 19 2012 Jay Belanger wrote: > >>From a different perspective, I'd say that "dimensionless" is as > > valid a unit as "kg" or "hbar / c". In that sense I'd say that there > > should be a possibility to pass this unit "dimensionless" as an arg > > to calc-convert-units, similar to any other unit that this function > > should use for its final result. > > Currently, if Calc is asked to convert part of a units expression, it > will leave any unrequested units unchanged; for example, if 45 mi/hr is > on the stack and the units conversion is called with new units m, then > only the mi will be changed; 45 mi/hr will be converted to 72420.48 m / > hr. To be consistent, I would think that converting to new units 1, all > of the units in the stack expression would be left alone. ...This might depend on whom you ask :-) I am speaking from a physics point of view. Other people might look at this from a different perspective. I would always consider the concept of "converting part of a units expression" to be not the main rule to follow here, but the exception if nothing else works because it is, in general, not unique which unit should be used for the remainder, if one converts, say, pc^2 into gal. On the other hand, if an expression can be converted to a dimensionless number, this involves no ambiguity. Also, I'd say that in real life one usually knows which unit an expression has. > > I'd say that "1" appears to be a natural choice in order to express > > the fact that Calc should obtain a dimensionless number. > > I suppose you mean /try/ to obtain a dimensionless number. > Calc could have a command that will convert an expression to a > dimensionless number, if possible, or leave it unchanged, if it cannot > be converted to a dimensionless number. I'm not sure that "u c" should > do such branching, but then I'm not sure this behavior is what you > meant. I assume that currently "u c" needs to branch already if this command needs to perform a partial conversion in the sense discussed above. I would consider this branch the last resort. If Calc discovers earlier that an expression can be interpreted as a dimensionless number, it should do that conversion if the user requested the unit "1". I just discovered what I would likewise consider an inconsistency in the current handling of units: Calc already defines the dimensionless fine structure constant alpha as a unit. If one has the expression "7 eV / J", one can convert it to alphas via "u c alpha". Yet if one first simplifies this with "u s", one just gets a dimensionless number 1.21e-18. This number cannot be converted anymore to alphas because Calc is missing an old unit. However, the result of a calculation should, of course, be independent of whether the intermediate simplification is done or not. This illustrates to me once more that it would be most natural to interpret dimensionless numbers as quantities that have the unit "1", though this unit is not spelled out explicitly. Then plain numbers can be converted to alphas without problem. If, on the other hand, one wanted to convert a plain number to some "dimensional unit" like "m", the concept of partial conversion implies that the expression remains unchanged because we would get something like "m / m". Note that conversion of "7 alpha" to "m" already gives the dimensionless number 0.051. (Alternatively, such a partial conversion could explicitly give the unit "m / m", similar to when we have "3 m" and "4 m", and we divide one by the other, then Calc does not simplify that automatically, but instead we get "0.75 m / m". But such a strategy would become rather confusing if we converted to more complicated units like "kg m^2 / s" thus giving "kg m^2 s / s m^2 kg".) I am confident that most physicists will agree on this. Roland From unknown Fri Aug 15 20:52:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc) Resent-From: Jay Belanger Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jan 2012 16:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10554 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "Roland Winkler" Cc: 10554@debbugs.gnu.org, jay.p.belanger@gmail.com Reply-To: jay.p.belanger@gmail.com Received: via spool by 10554-submit@debbugs.gnu.org id=B10554.132707822117673 (code B ref 10554); Fri, 20 Jan 2012 16:51:02 +0000 Received: (at 10554) by debbugs.gnu.org; 20 Jan 2012 16:50:21 +0000 Received: from localhost ([127.0.0.1]:36876 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RoHfQ-0004ax-LR for submit@debbugs.gnu.org; Fri, 20 Jan 2012 11:50:21 -0500 Received: from mail-yw0-f44.google.com ([209.85.213.44]:48195) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RoHfK-0004ak-Kt for 10554@debbugs.gnu.org; Fri, 20 Jan 2012 11:50:18 -0500 Received: by yhnn12 with SMTP id n12so312666yhn.3 for <10554@debbugs.gnu.org>; Fri, 20 Jan 2012 08:48:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:reply-to:cc:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=SGkxlTno3ORwh0p/BNFNBXVTnQluBVoEYe9JBW+27Cs=; b=meUZoK32Bj+CuOvRMdIwW1rTKh7/ozp1qpxFKmk+A0Xl1nN/szwXdXDVduxNCnSnKL 7+z/QZGMylOuHkWbC6daB9w067Fxljr16Q6wEQQazFaoB3EjWZkSFNvRJUgd+HiPuew+ xTmJytrgedxb0jogpFILFFyjqVol4hdseBLe8= Received: by 10.236.76.201 with SMTP id b49mr47708055yhe.11.1327078136045; Fri, 20 Jan 2012 08:48:56 -0800 (PST) Received: from belanger-home (184-155-95-203.cpe.cableone.net. [184.155.95.203]) by mx.google.com with ESMTPS id j16sm9515176anm.9.2012.01.20.08.48.52 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 20 Jan 2012 08:48:55 -0800 (PST) From: Jay Belanger References: <8762g8i7s6.fsf@niu.edu> <87bopz5pt8.fsf@gmail.com> <20248.39483.716850.185512@gargle.gargle.HOWL> <87d3afdlfz.fsf@gmail.com> <20249.10002.733142.491623@gargle.gargle.HOWL> Date: Fri, 20 Jan 2012 10:48:39 -0600 In-Reply-To: <20249.10002.733142.491623@gargle.gargle.HOWL> (Roland Winkler's message of "Fri, 20 Jan 2012 02:34:26 -0600") Message-ID: <8739bajp5k.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) > I would always consider the concept of "converting part of a units > expression" to be not the main rule to follow here, If 45 mi/hr is on the stack, and "u c" is called with new units km, what should happen? > but the exception if nothing else works because it is, in general, not > unique which unit should be used for the remainder, if one converts, > say, pc^2 into gal. If volume is converted to volume, there should be no remainder. > On the other hand, if an expression can be converted to a > dimensionless number, this involves no ambiguity. But what if you ask Calc to convert a units expression into a dimensionless number when it can't be so converted? Using a system name ("si", "cgs", etc.) as an output unit, as you did before, solves this problem. If the expression is dimensionless, then all units will cancel out. If the expression is not unitless, then any left over units will be given in the requested unit system. >> I suppose you mean /try/ to obtain a dimensionless number. >> Calc could have a command that will convert an expression to a >> dimensionless number, if possible, or leave it unchanged, if it cannot >> be converted to a dimensionless number. I'm not sure that "u c" should >> do such branching, but then I'm not sure this behavior is what you >> meant. > > I assume that currently "u c" needs to branch already if this > command needs to perform a partial conversion in the sense discussed > above. Perhaps I used the wrong word when I said "branch", I meant that Calc would have to look at the result it computes, and then decide whether to return that or return the original expression. Currently Calc doesn't do anything like that when it converts units. > Calc already defines the dimensionless fine structure constant alpha > as a unit. If one has the expression "7 eV / J", one can convert it > to alphas via "u c alpha". Yet if one first simplifies this with > "u s", one just gets a dimensionless number 1.21e-18. This number > cannot be converted anymore to alphas because Calc is missing an old > unit. If you try to convert it to alpha, you can use "1" as a default old unit and you can give it "alpha" as a new unit. (Since "1" can't be used as an output unit, it isn't obvious that it can be used an an input unit. Perhaps that's what this discussion is about.) > This illustrates to me once more that it would be most natural to > interpret dimensionless numbers as quantities that have the unit > "1", though this unit is not spelled out explicitly. That makes sense, and is what happens when you use "1" as the old (input) unit when converting a plain number to alphas. The problem with using "1" as a new (output) unit is that to be consistent with how it treats other units, choosing an output unit of "1" should be a no-op. Going back to converting 45 mi/hr with new units "km", what currently happens is that (mi/hr)/km is converted to 1.609344 / hr, so the result of the entire conversion will be 45*(1.609344 / hr)*km. If instead the new units are "1", then all that will happen is the expression on the stack will be divided by 1 and multiplied by 1. It doesn't seem to me that the dimensionless unit "1" should be handled differently than other units. (Granted, currently an output unit of 1 does give an error, but since it would be a no-op I doubt the user intended to give it anyhow.) > Then plain numbers can be converted to alphas without problem. If, > on the other hand, one wanted to convert a plain number to some > "dimensional unit" like "m", the concept of partial conversion > implies that the expression remains unchanged because we would get > something like "m / m". Note that conversion of "7 alpha" to "m" > already gives the dimensionless number 0.051. Right. That's how it currently works, and plain numbers can be converted to alphas. Jay From unknown Fri Aug 15 20:52:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc) Resent-From: "Roland Winkler" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jan 2012 17:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10554 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: jay.p.belanger@gmail.com Cc: 10554@debbugs.gnu.org Received: via spool by 10554-submit@debbugs.gnu.org id=B10554.132708220624747 (code B ref 10554); Fri, 20 Jan 2012 17:57:02 +0000 Received: (at 10554) by debbugs.gnu.org; 20 Jan 2012 17:56:46 +0000 Received: from localhost ([127.0.0.1]:36899 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RoIhi-0006R6-4n for submit@debbugs.gnu.org; Fri, 20 Jan 2012 12:56:46 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:56500) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RoIhf-0006Qy-1H for 10554@debbugs.gnu.org; Fri, 20 Jan 2012 12:56:44 -0500 Received: from u010774.lc.ehu.es ([158.227.8.163]:38446 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1RoIgN-0007OG-VZ; Fri, 20 Jan 2012 12:55:24 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20249.43656.150957.30947@gargle.gargle.HOWL> Date: Fri, 20 Jan 2012 11:55:20 -0600 From: "Roland Winkler" In-Reply-To: <8739bajp5k.fsf@gmail.com> References: <8762g8i7s6.fsf@niu.edu> <87bopz5pt8.fsf@gmail.com> <20248.39483.716850.185512@gargle.gargle.HOWL> <87d3afdlfz.fsf@gmail.com> <20249.10002.733142.491623@gargle.gargle.HOWL> <8739bajp5k.fsf@gmail.com> X-Mailer: VM 8.2 trial under 24.0.92.1 (x86_64-unknown-linux-gnu) X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) On Fri Jan 20 2012 Jay Belanger wrote: > > > I would always consider the concept of "converting part of a units > > expression" to be not the main rule to follow here, > > If 45 mi/hr is on the stack, and "u c" is called with new units km, what > should happen? Here the user is posing a problem with no uniquely defined answer. The answer could be expressed in km/hr but also in km/s or in km eV/hbar. This scenario I would always give the lowest priority. > > but the exception if nothing else works because it is, in > > general, not unique which unit should be used for the remainder, > > if one converts, say, pc^2 into gal. > > If volume is converted to volume, there should be no remainder. pc^2 specifies an area: 1 pc^2 is converted to 2.5e35 gal/m > But what if you ask Calc to convert a units expression into a > dimensionless number when it can't be so converted? again: I'd give this scenario the lowest priority. I'd say: most often the requested output unit does not match the dimension of the input because one made whatever mistake either in the expression to be converted or in the unit selected for the output. > If you try to convert it to alpha, you can use "1" as a default old > unit and you can give it "alpha" as a new unit. (Since "1" can't be > used as an output unit, it isn't obvious that it can be used an > an input unit. Perhaps that's what this discussion is about.) If I have a plain number on the stack and want it to be converted to alpha, I'll be asked for the old unit. - You are right: here one can specify "1" as the old unit. My problem is here that from my perspective as a Calc user (not worrying about any internals of Calc) the treatment of the unit "1" sticks out in various ways. In physics I'd call "1" a unit like all the other ones. In that sense it would be great if Calc could treat it that way, too. > (Granted, currently an output unit of 1 does give an error, but > since it would be a no-op I doubt the user intended to give it > anyhow.) This is the point where I want to argue the other way round: For me, it's perfectly valid and it would be great if one could use it like any other unit. > > Note that conversion of "7 alpha" to "m" already gives the > > dimensionless number 0.051. > > Right. That's how it currently works, I'd say that this example illustrates once more that any "partial conversion" is most often meaningless and not what the user might have intended. Roland From unknown Fri Aug 15 20:52:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc) Resent-From: Jay Belanger Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jan 2012 19:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10554 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "Roland Winkler" Cc: 10554@debbugs.gnu.org, jay.p.belanger@gmail.com Reply-To: jay.p.belanger@gmail.com Received: via spool by 10554-submit@debbugs.gnu.org id=B10554.1327086708350 (code B ref 10554); Fri, 20 Jan 2012 19:12:01 +0000 Received: (at 10554) by debbugs.gnu.org; 20 Jan 2012 19:11:48 +0000 Received: from localhost ([127.0.0.1]:36933 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RoJsK-00005b-In for submit@debbugs.gnu.org; Fri, 20 Jan 2012 14:11:48 -0500 Received: from mail.truman.edu ([150.243.162.204]:54789 helo=uranium.truman.edu) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RoJsI-00005J-6s for 10554@debbugs.gnu.org; Fri, 20 Jan 2012 14:11:46 -0500 Received: from belanger-office (vh213601.truman.edu [150.243.162.59]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by uranium.truman.edu (Postfix) with ESMTPS id ED9CA128183; Fri, 20 Jan 2012 13:10:21 -0600 (CST) From: Jay Belanger References: <8762g8i7s6.fsf@niu.edu> <87bopz5pt8.fsf@gmail.com> <20248.39483.716850.185512@gargle.gargle.HOWL> <87d3afdlfz.fsf@gmail.com> <20249.10002.733142.491623@gargle.gargle.HOWL> <8739bajp5k.fsf@gmail.com> <20249.43656.150957.30947@gargle.gargle.HOWL> Date: Fri, 20 Jan 2012 13:10:22 -0600 In-Reply-To: <20249.43656.150957.30947@gargle.gargle.HOWL> (Roland Winkler's message of "Fri, 20 Jan 2012 11:55:20 -0600") Message-ID: <8739bab36p.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.1 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.1 (-) >> > I would always consider the concept of "converting part of a units >> > expression" to be not the main rule to follow here, >> >> If 45 mi/hr is on the stack, and "u c" is called with new units km, what >> should happen? > > Here the user is posing a problem with no uniquely defined answer. > The answer could be expressed in km/hr but also in km/s or in km eV/hbar. But what /should/ happen? Would you like an error signaled? Otherwise, the current behavior is the most reasonable. >> But what if you ask Calc to convert a units expression into a >> dimensionless number when it can't be so converted? > > again: I'd give this scenario the lowest priority. I'm not sure what you mean by giving it low priority. Either it happens or it doesn't, and Calc needs to do something if it happens. > In physics I'd call "1" a unit like all the other ones. In that sense > it would be great if Calc could treat it that way, too. Calc does that; it looks to me as if you want it treated special. It seems to me as if you want to get rid of Calc's ability to deal with inconsistent units, but that's pretty established Calc behavior. Jay From unknown Fri Aug 15 20:52:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc) Resent-From: "Roland Winkler" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jan 2012 20:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10554 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: jay.p.belanger@gmail.com Cc: 10554@debbugs.gnu.org Received: via spool by 10554-submit@debbugs.gnu.org id=B10554.132709150512874 (code B ref 10554); Fri, 20 Jan 2012 20:32:02 +0000 Received: (at 10554) by debbugs.gnu.org; 20 Jan 2012 20:31:45 +0000 Received: from localhost ([127.0.0.1]:36995 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RoL7h-0003La-BT for submit@debbugs.gnu.org; Fri, 20 Jan 2012 15:31:45 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:59126) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RoL7f-0003LS-GA for 10554@debbugs.gnu.org; Fri, 20 Jan 2012 15:31:44 -0500 Received: from 82.red-80-32-229.staticip.rima-tde.net ([80.32.229.82]:50872 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1RoL6M-0006T0-8z; Fri, 20 Jan 2012 15:30:24 -0500 Message-ID: <20249.52946.931367.162775@gargle.gargle.HOWL> Date: Fri, 20 Jan 2012 14:30:10 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: "Roland Winkler" In-Reply-To: <8739bab36p.fsf@gmail.com> References: <8762g8i7s6.fsf@niu.edu> <87bopz5pt8.fsf@gmail.com> <20248.39483.716850.185512@gargle.gargle.HOWL> <87d3afdlfz.fsf@gmail.com> <20249.10002.733142.491623@gargle.gargle.HOWL> <8739bajp5k.fsf@gmail.com> <20249.43656.150957.30947@gargle.gargle.HOWL> <8739bab36p.fsf@gmail.com> X-Mailer: VM 8.2 trial under 24.0.92.1 (x86_64-unknown-linux-gnu) X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) On Fri Jan 20 2012 Jay Belanger wrote: > > Here the user is posing a problem with no uniquely defined answer. > > The answer could be expressed in km/hr but also in km/s or in km eV/hbar. > > But what /should/ happen? Would you like an error signaled? Otherwise, > the current behavior is the most reasonable. I would, indeed, consider it quite OK if an error was signaled. Say, if there was an option calc-throw-error-if-units-mismatch, I'd bind it to t. > >> But what if you ask Calc to convert a units expression into a > >> dimensionless number when it can't be so converted? > > > > again: I'd give this scenario the lowest priority. > > I'm not sure what you mean by giving it low priority. Either it > happens or it doesn't, and Calc needs to do something if it > happens. I guess we can have the following scenarios that can be handled as follows: (1) If the old expression and the new unit have the same dimension, "1" should be treated like any other unit. So this means: - if the old expression has units that cancel completely (e.g., as in my orginal bug report) or it has a unit like "alpha", one can specify "1" as the new unit and the unit conversion returns a plain number. - similarly: if the old expression is just a number (i.e., unit "1"), this can be converted to other dimensionless units such as "alpha" without being asked for the old unit. (Yes, I am irritated if calc-convert-units asks me about the old unit if there is just a plain number on the stack. So backward compatibility would probably require a variable such as calc-treat-numbers-as-dimensional, bound to nil by default.) (2) The old expression is not dimensionless such as "7 m", the new unit is "1". Here I suggest that partial conversion means to return the old expression without any unit conversion. (this would be quite consistent with how Calc already treats the case that the old expression is something like "7 m", and the new unit is "alpha".) (3) The old expression is a dimensionless number, the requested new unit is something like "m": Here I suggest to just return the old expression unmodified (again, this would be quite consistent with how Calc already treats the case that the old expression is something like "7 alpha", where conversion to any other unit gives a dimensionless number. Did I miss another possibility? If yes, I am sure that it has a reasonable solution, too. (Even if Calc handled dimensionless quantities this way, I would bind calc-throw-error-if-units-mismatch to t because in my work a unit mismatch between old and new means a mismatch between what I have and what I expect to get.) Roland From unknown Fri Aug 15 20:52:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc) Resent-From: "Roland Winkler" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jan 2012 20:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10554 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: jay.p.belanger@gmail.com Cc: 10554@debbugs.gnu.org Received: via spool by 10554-submit@debbugs.gnu.org id=B10554.132709190413579 (code B ref 10554); Fri, 20 Jan 2012 20:39:02 +0000 Received: (at 10554) by debbugs.gnu.org; 20 Jan 2012 20:38:24 +0000 Received: from localhost ([127.0.0.1]:36999 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RoLE8-0003Wy-75 for submit@debbugs.gnu.org; Fri, 20 Jan 2012 15:38:24 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:59313) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RoLE5-0003Wq-BV for 10554@debbugs.gnu.org; Fri, 20 Jan 2012 15:38:22 -0500 Received: from 82.red-80-32-229.staticip.rima-tde.net ([80.32.229.82]:50912 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1RoLCn-0006zn-Hh; Fri, 20 Jan 2012 15:37:02 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20249.53350.897412.147504@gargle.gargle.HOWL> Date: Fri, 20 Jan 2012 14:36:54 -0600 From: "Roland Winkler" In-Reply-To: <8739bab36p.fsf@gmail.com> References: <8762g8i7s6.fsf@niu.edu> <87bopz5pt8.fsf@gmail.com> <20248.39483.716850.185512@gargle.gargle.HOWL> <87d3afdlfz.fsf@gmail.com> <20249.10002.733142.491623@gargle.gargle.HOWL> <8739bajp5k.fsf@gmail.com> <20249.43656.150957.30947@gargle.gargle.HOWL> <8739bab36p.fsf@gmail.com> X-Mailer: VM 8.2 trial under 24.0.92.1 (x86_64-unknown-linux-gnu) X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) I should add: For me, Calc is one of the greatest tools in Emacs, and the unit converter is a wonderful tool within Calc. Thanks a lot for maintaining this package!! Roland From unknown Fri Aug 15 20:52:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc) Resent-From: Jay Belanger Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jan 2012 20:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10554 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "Roland Winkler" Cc: 10554@debbugs.gnu.org, jay.p.belanger@gmail.com Reply-To: jay.p.belanger@gmail.com Received: via spool by 10554-submit@debbugs.gnu.org id=B10554.132709295715439 (code B ref 10554); Fri, 20 Jan 2012 20:56:01 +0000 Received: (at 10554) by debbugs.gnu.org; 20 Jan 2012 20:55:57 +0000 Received: from localhost ([127.0.0.1]:37003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RoLV7-00040y-MO for submit@debbugs.gnu.org; Fri, 20 Jan 2012 15:55:57 -0500 Received: from mail.truman.edu ([150.243.162.204]:46975 helo=uranium.truman.edu) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RoLV6-00040g-BQ for 10554@debbugs.gnu.org; Fri, 20 Jan 2012 15:55:56 -0500 Received: from belanger-office (vh213601.truman.edu [150.243.162.59]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by uranium.truman.edu (Postfix) with ESMTPS id B95721281FB; Fri, 20 Jan 2012 14:54:31 -0600 (CST) From: Jay Belanger References: <8762g8i7s6.fsf@niu.edu> <87bopz5pt8.fsf@gmail.com> <20248.39483.716850.185512@gargle.gargle.HOWL> <87d3afdlfz.fsf@gmail.com> <20249.10002.733142.491623@gargle.gargle.HOWL> <8739bajp5k.fsf@gmail.com> <20249.43656.150957.30947@gargle.gargle.HOWL> <8739bab36p.fsf@gmail.com> <20249.52946.931367.162775@gargle.gargle.HOWL> Date: Fri, 20 Jan 2012 14:54:32 -0600 In-Reply-To: <20249.52946.931367.162775@gargle.gargle.HOWL> (Roland Winkler's message of "Fri, 20 Jan 2012 14:30:10 -0600") Message-ID: <87lip29jsn.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.1 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.1 (-) >> But what /should/ happen? Would you like an error signaled? Otherwise, >> the current behavior is the most reasonable. > > I would, indeed, consider it quite OK if an error was signaled. Say, > if there was an option calc-throw-error-if-units-mismatch, I'd bind > it to t. Having such an option shouldn't be too hard to take care of, after 24.1 comes out. By default, though, the current behavior shouldn't change, and so the option should have default value nil. Jay From unknown Fri Aug 15 20:52:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc) Resent-From: "Roland Winkler" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jan 2012 22:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10554 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: jay.p.belanger@gmail.com Cc: 10554@debbugs.gnu.org Received: via spool by 10554-submit@debbugs.gnu.org id=B10554.132709754323882 (code B ref 10554); Fri, 20 Jan 2012 22:13:02 +0000 Received: (at 10554) by debbugs.gnu.org; 20 Jan 2012 22:12:23 +0000 Received: from localhost ([127.0.0.1]:37019 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RoMh5-0006D6-7v for submit@debbugs.gnu.org; Fri, 20 Jan 2012 17:12:23 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:60860) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RoMh2-0006Cy-0H for 10554@debbugs.gnu.org; Fri, 20 Jan 2012 17:12:21 -0500 Received: from [83.175.202.27] (port=51023 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1RoMfi-0007IT-6n; Fri, 20 Jan 2012 17:11:00 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20249.58980.778477.37221@gargle.gargle.HOWL> Date: Fri, 20 Jan 2012 16:10:44 -0600 From: "Roland Winkler" In-Reply-To: <87lip29jsn.fsf@gmail.com> References: <8762g8i7s6.fsf@niu.edu> <87bopz5pt8.fsf@gmail.com> <20248.39483.716850.185512@gargle.gargle.HOWL> <87d3afdlfz.fsf@gmail.com> <20249.10002.733142.491623@gargle.gargle.HOWL> <8739bajp5k.fsf@gmail.com> <20249.43656.150957.30947@gargle.gargle.HOWL> <8739bab36p.fsf@gmail.com> <20249.52946.931367.162775@gargle.gargle.HOWL> <87lip29jsn.fsf@gmail.com> X-Mailer: VM 8.2 trial under 24.0.92.1 (x86_64-unknown-linux-gnu) X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) On Fri Jan 20 2012 Jay Belanger wrote: > > I would, indeed, consider it quite OK if an error was signaled. Say, > > if there was an option calc-throw-error-if-units-mismatch, I'd bind > > it to t. > > Having such an option shouldn't be too hard to take care of, after 24.1 > comes out. By default, though, the current behavior shouldn't change, > and so the option should have default value nil. Great, thanks! Do you also see a possiblity to implement the other scheme I suggested (attached below once more)? That would be wonderful! Roland I guess we can have the following scenarios that can be handled as follows: (1) If the old expression and the new unit have the same dimension, "1" should be treated like any other unit. So this means: - if the old expression has units that cancel completely (e.g., as in my orginal bug report) or it has a unit like "alpha", one can specify "1" as the new unit and the unit conversion returns a plain number. - similarly: if the old expression is just a number (i.e., unit "1"), this can be converted to other dimensionless units such as "alpha" without being asked for the old unit. (Yes, I am irritated if calc-convert-units asks me about the old unit if there is just a plain number on the stack. So backward compatibility would probably require a variable such as calc-treat-numbers-as-dimensional, bound to nil by default.) (2) The old expression is not dimensionless such as "7 m", the new unit is "1". Here I suggest that partial conversion means to return the old expression without any unit conversion. (this would be quite consistent with how Calc already treats the case that the old expression is something like "7 m", and the new unit is "alpha".) (3) The old expression is a dimensionless number, the requested new unit is something like "m": Here I suggest to just return the old expression unmodified (again, this would be quite consistent with how Calc already treats the case that the old expression is something like "7 alpha", where conversion to any other unit gives a dimensionless number. Did I miss another possibility? If yes, I am sure that it has a reasonable solution, too. From unknown Fri Aug 15 20:52:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc) Resent-From: Jay Belanger Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Jan 2012 00:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10554 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "Roland Winkler" Cc: 10554@debbugs.gnu.org, jay.p.belanger@gmail.com Reply-To: jay.p.belanger@gmail.com Received: via spool by 10554-submit@debbugs.gnu.org id=B10554.13271041273337 (code B ref 10554); Sat, 21 Jan 2012 00:03:01 +0000 Received: (at 10554) by debbugs.gnu.org; 21 Jan 2012 00:02:07 +0000 Received: from localhost ([127.0.0.1]:37038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RoOPG-0000rl-Cv for submit@debbugs.gnu.org; Fri, 20 Jan 2012 19:02:07 -0500 Received: from mail-gy0-f172.google.com ([209.85.160.172]:63651) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RoOPD-0000rZ-4L for 10554@debbugs.gnu.org; Fri, 20 Jan 2012 19:02:04 -0500 Received: by ghbg16 with SMTP id g16so102144ghb.3 for <10554@debbugs.gnu.org>; Fri, 20 Jan 2012 16:00:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:reply-to:cc:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=xVnSKHQhgv6jhzsFrpNqZ7rcrnmYD52x4m7Ugcm1NYs=; b=CqZ4KjK26bMVwjxas2KduTcBZOPldA491xpXQLZHpWnMRCEwMy2qMkw9Be3cm0QZsy +B7nqDMIQRkAshHEPFskfbBEfJN4LZQ+ZdCIg5Y2T8a1wimg+Zm0b9YeSpEniyL7jJ3b I8rVtC4QM3unruvHGQLODreLOQtlu5pBHirqY= Received: by 10.236.200.164 with SMTP id z24mr49719332yhn.52.1327104042899; Fri, 20 Jan 2012 16:00:42 -0800 (PST) Received: from belanger-home (184-155-95-203.cpe.cableone.net. [184.155.95.203]) by mx.google.com with ESMTPS id 9sm12515458ans.15.2012.01.20.16.00.40 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 20 Jan 2012 16:00:42 -0800 (PST) From: Jay Belanger References: <8762g8i7s6.fsf@niu.edu> <87bopz5pt8.fsf@gmail.com> <20248.39483.716850.185512@gargle.gargle.HOWL> <87d3afdlfz.fsf@gmail.com> <20249.10002.733142.491623@gargle.gargle.HOWL> <8739bajp5k.fsf@gmail.com> <20249.43656.150957.30947@gargle.gargle.HOWL> <8739bab36p.fsf@gmail.com> <20249.52946.931367.162775@gargle.gargle.HOWL> <87lip29jsn.fsf@gmail.com> <20249.58980.778477.37221@gargle.gargle.HOWL> Date: Fri, 20 Jan 2012 18:00:39 -0600 In-Reply-To: <20249.58980.778477.37221@gargle.gargle.HOWL> (Roland Winkler's message of "Fri, 20 Jan 2012 16:10:44 -0600") Message-ID: <87r4yt9b6g.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) > Great, thanks! Do you also see a possiblity to implement the other > scheme I suggested (attached below once more)? That would be > wonderful! ... > - if the old expression has units that cancel completely (e.g., > as in my orginal bug report) or it has a unit like "alpha", > one can specify "1" as the new unit and the unit conversion > returns a plain number. If the "error if the units don't match" option is chosen, I would think this would naturally be the default. If partial conversions are allowed, I don't think "1" as a unit should trigger an error, but I think it should still be a no-op. > - similarly: if the old expression is just a number (i.e., unit > "1"), this can be converted to other dimensionless units such > as "alpha" without being asked for the old unit. This I'm not too sure about. The current behavior allows the user to convert units without having the units explicit in the expression, so for example 45 u c mi/hr RET km/hr would convert 45 mi/hr to km/hr. This, I believe, was put in as a feature, not a bug. > (Yes, I am irritated if calc-convert-units asks me about the > old unit if there is just a plain number on the stack. So > backward compatibility would probably require a variable such > as calc-treat-numbers-as-dimensional, bound to nil by > default.) An option might be reasonable, with the current behavior the default. But this would only be useful when changing a number to a dimensionless quantity, like alpha, it seems. > (2) The old expression is not dimensionless such as "7 m", the new > unit is "1". Here I suggest that partial conversion means to > return the old expression without any unit conversion. Basically the current behavior (without the error). But with the "need matching units", this should give an error. > (this would be quite consistent with how Calc already treats the > case that the old expression is something like "7 m", and the > new unit is "alpha".) > > (3) The old expression is a dimensionless number, the requested new > unit is something like "m": > > Here I suggest to just return the old expression unmodified Unless the "need matching units" option is chosen, in which case this would give an error. From unknown Fri Aug 15 20:52:35 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: "Roland Winkler" Subject: bug#10554: closed (Re: bug#10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc)) Message-ID: References: <87k44lu1lk.fsf@gmail.com> <8762g8i7s6.fsf@niu.edu> X-Gnu-PR-Message: they-closed 10554 X-Gnu-PR-Package: emacs Reply-To: 10554@debbugs.gnu.org Date: Sat, 21 Jan 2012 04:23:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1327119782-19193-1" This is a multi-part message in MIME format... ------------=_1327119782-19193-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc) which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 10554@debbugs.gnu.org. --=20 10554: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D10554 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1327119782-19193-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 10554-done) by debbugs.gnu.org; 21 Jan 2012 04:22:12 +0000 Received: from localhost ([127.0.0.1]:38106 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RoSSx-0004yV-Ml for submit@debbugs.gnu.org; Fri, 20 Jan 2012 23:22:11 -0500 Received: from mail-tul01m020-f172.google.com ([209.85.214.172]:40009) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RoSSv-0004yE-Mz for 10554-done@debbugs.gnu.org; Fri, 20 Jan 2012 23:22:10 -0500 Received: by obbwc12 with SMTP id wc12so1472464obb.3 for <10554-done@debbugs.gnu.org>; Fri, 20 Jan 2012 20:22:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:references:reply-to:cc:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=FAjQTF1qQaNQetFJArlroYBSGNyZdJcQNn4/823Zygw=; b=u2GxLkSsJHvkoyZ844I1+mMp1m9y4ne02t4ErWNxb/bYYFlop4VuO6A5pwe1KMz9uq WrHV5Bpfll6zeLxtveuYXIdKrISLPqvKAdxiEi9hh+hP2GcBS5f/rCmK0vkDV8PO5xaG FcsAOgZonDdfdKuFeuuQJwmEI+iy0BP9ku7Rs= Received: by 10.182.160.5 with SMTP id xg5mr420021obb.53.1327119723198; Fri, 20 Jan 2012 20:22:03 -0800 (PST) Received: from belanger-x100e (184-155-95-203.cpe.cableone.net. [184.155.95.203]) by mx.google.com with ESMTPS id t9sm249886obv.8.2012.01.20.20.22.01 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 20 Jan 2012 20:22:02 -0800 (PST) From: Jay Belanger To: 10554-done@debbugs.gnu.org Subject: Re: bug#10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc) References: <8762g8i7s6.fsf@niu.edu> Date: Fri, 20 Jan 2012 22:21:59 -0600 In-Reply-To: <8762g8i7s6.fsf@niu.edu> (Roland Winkler's message of "Wed, 18 Jan 2012 23:24:41 -0600") Message-ID: <87k44lu1lk.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 10554-done Cc: jay.p.belanger@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: jay.p.belanger@gmail.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) > In Calc type > > 'e T m^2 / hbar > > Convert this to SI units with u c si RET > - That's perfect. We get a dimensionless number. > Let's try again. In Calc type (more my range of numbers) > > 'e T nm^2 / hbar > > Now when we type again u c, Calc remembers what we did before. > So as a unit it offers "default 1". Let's take this default. > So just type RET > > Error: No units specified > > In other words: if an expression with units simplifies to a > dimensionless number, Calc does not accept the unit "1", though it > even offers this unit as a default for calc-convert-units. The version of Calc in bzr Emacs will no longer offer "1" as a default. ------------=_1327119782-19193-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 19 Jan 2012 05:26:12 +0000 Received: from localhost ([127.0.0.1]:35042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RnkVj-0002TL-4N for submit@debbugs.gnu.org; Thu, 19 Jan 2012 00:26:11 -0500 Received: from eggs.gnu.org ([140.186.70.92]:53250) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RnkVf-0002TB-Lz for submit@debbugs.gnu.org; Thu, 19 Jan 2012 00:26:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RnkUX-00031I-9K for submit@debbugs.gnu.org; Thu, 19 Jan 2012 00:24:54 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([140.186.70.17]:44056) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnkUX-00031E-7v for submit@debbugs.gnu.org; Thu, 19 Jan 2012 00:24:53 -0500 Received: from eggs.gnu.org ([140.186.70.92]:42529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnkUW-0004zL-Fh for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2012 00:24:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RnkUV-000314-Gy for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2012 00:24:52 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:50166) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnkUV-000310-EI for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2012 00:24:51 -0500 Received: from 82.red-80-32-229.staticip.rima-tde.net ([80.32.229.82]:47350 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1RnkUU-0000ZC-UF for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2012 00:24:51 -0500 Date: Wed, 18 Jan 2012 23:24:41 -0600 Message-Id: <8762g8i7s6.fsf@niu.edu> From: "Roland Winkler" To: bug-gnu-emacs@gnu.org Subject: 24.0.92; No units specified (dimensionless quantities in Emacs Calc) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) In Calc type 'e T m^2 / hbar Convert this to SI units with u c si RET - That's perfect. We get a dimensionless number. Let's try again. In Calc type (more my range of numbers) 'e T nm^2 / hbar Now when we type again u c, Calc remembers what we did before. So as a unit it offers "default 1". Let's take this default. So just type RET Error: No units specified In other words: if an expression with units simplifies to a dimensionless number, Calc does not accept the unit "1", though it even offers this unit as a default for calc-convert-units. In GNU Emacs 24.0.92.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.20.1) of 2011-12-14 on regnitz Windowing system distributor `The X.Org Foundation', version 11.0.10706000 ------------=_1327119782-19193-1-- From unknown Fri Aug 15 20:52:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc) Resent-From: "Roland Winkler" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Jan 2012 09:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10554 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: jay.p.belanger@gmail.com Cc: 10554@debbugs.gnu.org Received: via spool by 10554-submit@debbugs.gnu.org id=B10554.132713789613627 (code B ref 10554); Sat, 21 Jan 2012 09:25:02 +0000 Received: (at 10554) by debbugs.gnu.org; 21 Jan 2012 09:24:56 +0000 Received: from localhost ([127.0.0.1]:38142 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RoXBv-0003Xk-U3 for submit@debbugs.gnu.org; Sat, 21 Jan 2012 04:24:56 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:39354 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RoXBs-0003Xa-Ua for 10554@debbugs.gnu.org; Sat, 21 Jan 2012 04:24:54 -0500 Received: from 82.red-80-32-229.staticip.rima-tde.net ([80.32.229.82]:52370 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1RoXBp-0003RU-4t; Sat, 21 Jan 2012 04:24:50 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20250.33882.89017.12372@gargle.gargle.HOWL> Date: Sat, 21 Jan 2012 03:24:42 -0600 From: "Roland Winkler" In-Reply-To: <87r4yt9b6g.fsf@gmail.com> References: <8762g8i7s6.fsf@niu.edu> <87bopz5pt8.fsf@gmail.com> <20248.39483.716850.185512@gargle.gargle.HOWL> <87d3afdlfz.fsf@gmail.com> <20249.10002.733142.491623@gargle.gargle.HOWL> <8739bajp5k.fsf@gmail.com> <20249.43656.150957.30947@gargle.gargle.HOWL> <8739bab36p.fsf@gmail.com> <20249.52946.931367.162775@gargle.gargle.HOWL> <87lip29jsn.fsf@gmail.com> <20249.58980.778477.37221@gargle.gargle.HOWL> <87r4yt9b6g.fsf@gmail.com> X-Mailer: VM 8.2 trial under 24.0.92.1 (x86_64-unknown-linux-gnu) X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) On Fri Jan 20 2012 Jay Belanger wrote: > > - if the old expression has units that cancel completely (e.g., > > as in my orginal bug report) or it has a unit like "alpha", > > one can specify "1" as the new unit and the unit conversion > > returns a plain number. > > If the "error if the units don't match" option is chosen, I would think > this would naturally be the default. If partial conversions are > allowed, I don't think "1" as a unit should trigger an error, but I > think it should still be a no-op. If the old expression was "7 in / m" and the new unit is "1", this should be converted to 0.178, - This is already the answer we get from calc-simplify-units. - For an explicitly defined new trivial unit "one" (see below), conversion of "7 in / m" to "one" already gives "0.178 one". (A purist might even argue that something like "0.178 one" should be the answer to be returned by calc-simplify-units.) So this is all quite consistent. This has nothing to do with the value of a new user option calc-need-matching-units. > > (Yes, I am irritated if calc-convert-units asks me about the > > old unit if there is just a plain number on the stack. So > > backward compatibility would probably require a variable such > > as calc-treat-numbers-as-dimensional, bound to nil by > > default.) > > An option might be reasonable, with the current behavior the default. > But this would only be useful when changing a number to a dimensionless > quantity, like alpha, it seems. No, I don't see a need to further distiguish here, see below my discussion of an explicitly defined trivial unit "one". If the old expression is just a plain number, Calc should do the same thing it is doing currently if the old expression is given the unit "one" instead. In that sense, I am essentially requesting that these cases should be handled more consistently. > > (2) The old expression is not dimensionless such as "7 m", the new > > unit is "1". Here I suggest that partial conversion means to > > return the old expression without any unit conversion. > > Basically the current behavior (without the error). But with the "need > matching units", this should give an error. Exactly. > > (3) The old expression is a dimensionless number, the requested new > > unit is something like "m": > > > > Here I suggest to just return the old expression unmodified > > Unless the "need matching units" option is chosen, in which case this > would give an error. Exactly. Everything I am suggesting here is consistent / equivalent with the existing behavior of Calc for complete or partial conversion of units, independent of the value of a new user option calc-need-matching-units, in the following way: We can define a trivial unit (add-to-list 'math-additional-units '(one "1" "One")) So every plain, dimensionless number in Calc can be converted to ones. "7" becomes "7 one", in much the same way "7" becomes "960 alpha". Then the exisiting Calc code is already properly converting "7 one" to other units, both completely or partially. Likewise, "one" can be choosen as a new unit of an expression with whatever units. So I suggest: Calc should interpret dimensionless numbers such as "7" equivalent to "7 one" without the need to explicitly make this trivial conversion in either direction. In other words, "one" becomes an "invisible" unit for dimensionless numbers. That means: - If Calc finds a dimensionless number "7" on the stack, for unit conversions it gets interpreted as "7 one" - The string "1" should consistently become a valid short-hand notation for specifying the invisible unit "one" when calling something like calc-convert-units. If such a behavior gets implemented it immediately covers the cases (1) - (3) in my previous email including all their subcases. - There is no ambiguity in this concept. - It is fully consistent with Calc's current treatment of an explcit definition of the trivial unit "one". All this has nothing to do with what value is chosen for a user option calc-need-matching-units. Just use again the behavior one may expect in either case for an explicitly defined unit "one". As discussed already, backward compatibility will require a user variable calc-treat-numbers-as-dimensional, bound to nil by default. There might be other situations where the requested treatment of dimensionless numbers implies a deviation from the current behavior so that this might require another user option. However all in all, these changes will make the treatment of units more consistent within Calc and also more consistent with how units are used elsewhere. (Though I have a physicist's perspective, I hope that engineers and other disciplines will not disagree here.) Roland From unknown Fri Aug 15 20:52:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc) Resent-From: Jay Belanger Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Jan 2012 14:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10554 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "Roland Winkler" Cc: 10554@debbugs.gnu.org, jay.p.belanger@gmail.com Reply-To: jay.p.belanger@gmail.com Received: via spool by 10554-submit@debbugs.gnu.org id=B10554.132715713916294 (code B ref 10554); Sat, 21 Jan 2012 14:46:02 +0000 Received: (at 10554) by debbugs.gnu.org; 21 Jan 2012 14:45:39 +0000 Received: from localhost ([127.0.0.1]:38679 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RocCJ-0004El-5Y for submit@debbugs.gnu.org; Sat, 21 Jan 2012 09:45:39 -0500 Received: from mail-tul01m020-f172.google.com ([209.85.214.172]:60046) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RocCE-0004EW-5H for 10554@debbugs.gnu.org; Sat, 21 Jan 2012 09:45:35 -0500 Received: by obbwc12 with SMTP id wc12so1712961obb.3 for <10554@debbugs.gnu.org>; Sat, 21 Jan 2012 06:45:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:reply-to:cc:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=Vr6GqYlp3EDrfu/EpKMcUTJl/Hd0NodgZvYXcwT/z+8=; b=dEKBtHZbgdeUbH7ErQE+Mu43v9ZKhZfkvM0Te7OwL+0EjPDdRLJKozYDLsX8mPhdMs uwK7z5iyXV1s6mQEuYTXaOvclOtVJIkD/HWciFZ8DXo8TbLixtiDdIlLTL9+PipftnjZ nnrDwZ41snpHo7X0l5ZZ2i5OcUpt2Doyx6kxg= Received: by 10.182.147.106 with SMTP id tj10mr1803108obb.12.1327157125187; Sat, 21 Jan 2012 06:45:25 -0800 (PST) Received: from belanger-x100e (184-155-95-203.cpe.cableone.net. [184.155.95.203]) by mx.google.com with ESMTPS id l1sm6596384obv.1.2012.01.21.06.45.23 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 21 Jan 2012 06:45:24 -0800 (PST) From: Jay Belanger References: <8762g8i7s6.fsf@niu.edu> <87bopz5pt8.fsf@gmail.com> <20248.39483.716850.185512@gargle.gargle.HOWL> <87d3afdlfz.fsf@gmail.com> <20249.10002.733142.491623@gargle.gargle.HOWL> <8739bajp5k.fsf@gmail.com> <20249.43656.150957.30947@gargle.gargle.HOWL> <8739bab36p.fsf@gmail.com> <20249.52946.931367.162775@gargle.gargle.HOWL> <87lip29jsn.fsf@gmail.com> <20249.58980.778477.37221@gargle.gargle.HOWL> <87r4yt9b6g.fsf@gmail.com> <20250.33882.89017.12372@gargle.gargle.HOWL> Date: Sat, 21 Jan 2012 08:45:21 -0600 In-Reply-To: <20250.33882.89017.12372@gargle.gargle.HOWL> (Roland Winkler's message of "Sat, 21 Jan 2012 03:24:42 -0600") Message-ID: <8739b9w1vi.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) > If the old expression was "7 in / m" and the new unit is "1", this > should be converted to 0.178, > > - This is already the answer we get from calc-simplify-units. Right, so if the user wants the units simplified, they can call calc-simplify-units. If the user wants to convert units, they can call calc-convert-units. > So every plain, dimensionless number in Calc can be converted to > ones. "7" becomes "7 one", There is no need for that. "7" is fine. Jay From unknown Fri Aug 15 20:52:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc) Resent-From: "Roland Winkler" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Jan 2012 15:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10554 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: jay.p.belanger@gmail.com Cc: 10554@debbugs.gnu.org Received: via spool by 10554-submit@debbugs.gnu.org id=B10554.132715874619100 (code B ref 10554); Sat, 21 Jan 2012 15:13:02 +0000 Received: (at 10554) by debbugs.gnu.org; 21 Jan 2012 15:12:26 +0000 Received: from localhost ([127.0.0.1]:39238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RoccD-0004y1-N6 for submit@debbugs.gnu.org; Sat, 21 Jan 2012 10:12:26 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:43363 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RoccB-0004xq-2a for 10554@debbugs.gnu.org; Sat, 21 Jan 2012 10:12:24 -0500 Received: from [83.175.202.27] (port=53640 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Rocc5-0003UY-EP; Sat, 21 Jan 2012 10:12:19 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20250.54720.342718.59012@gargle.gargle.HOWL> Date: Sat, 21 Jan 2012 09:12:00 -0600 From: "Roland Winkler" In-Reply-To: <8739b9w1vi.fsf@gmail.com> References: <8762g8i7s6.fsf@niu.edu> <87bopz5pt8.fsf@gmail.com> <20248.39483.716850.185512@gargle.gargle.HOWL> <87d3afdlfz.fsf@gmail.com> <20249.10002.733142.491623@gargle.gargle.HOWL> <8739bajp5k.fsf@gmail.com> <20249.43656.150957.30947@gargle.gargle.HOWL> <8739bab36p.fsf@gmail.com> <20249.52946.931367.162775@gargle.gargle.HOWL> <87lip29jsn.fsf@gmail.com> <20249.58980.778477.37221@gargle.gargle.HOWL> <87r4yt9b6g.fsf@gmail.com> <20250.33882.89017.12372@gargle.gargle.HOWL> <8739b9w1vi.fsf@gmail.com> X-Mailer: VM 8.2 trial under 24.0.92.1 (x86_64-unknown-linux-gnu) X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) On Sat Jan 21 2012 Jay Belanger wrote: > > So every plain, dimensionless number in Calc can be converted to > > ones. "7" becomes "7 one", > > There is no need for that. "7" is fine. But this implies that internally Calc must interpret "7" as if it was "7 one". Only then can one convert "7" to other dimensionless units such as the "e T nm^2 / hbar" that appeared in my original bug report. Currently the latter unit conversion does require the superfluous step that one tells Calc in one or the other way that "7" means "7 one". I suggest that this superfluous step should not be required. Roland From unknown Fri Aug 15 20:52:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc) Resent-From: Jay Belanger Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Jan 2012 15:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10554 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "Roland Winkler" Cc: 10554@debbugs.gnu.org, jay.p.belanger@gmail.com Reply-To: jay.p.belanger@gmail.com Received: via spool by 10554-submit@debbugs.gnu.org id=B10554.132715973320492 (code B ref 10554); Sat, 21 Jan 2012 15:29:02 +0000 Received: (at 10554) by debbugs.gnu.org; 21 Jan 2012 15:28:53 +0000 Received: from localhost ([127.0.0.1]:39243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rocs9-0005KT-J4 for submit@debbugs.gnu.org; Sat, 21 Jan 2012 10:28:53 -0500 Received: from mail-tul01m020-f172.google.com ([209.85.214.172]:47721) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rocs7-0005KG-Ec for 10554@debbugs.gnu.org; Sat, 21 Jan 2012 10:28:51 -0500 Received: by obbwc12 with SMTP id wc12so1736194obb.3 for <10554@debbugs.gnu.org>; Sat, 21 Jan 2012 07:28:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:reply-to:cc:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=Vt9RsQ9Dq6rhNGdpvzPCZqksX01mjGHntDxw0K4yg4M=; b=vHB1c/WD9dfETyBw+bB1a7j8x99mJ28jMhPqIlXTovy576ec6FO8//S1z4yw/pygQZ jk7jiXVLhX0Kon1EP7E3HU2OLfEPctc6I3QwF0v7ycdFymeLvLBVQhdWTu0tuc119bFw h4deoU7Hm1jZHt1UGv7OHqSafDQBk8anEdDnE= Received: by 10.182.72.74 with SMTP id b10mr1809200obv.69.1327159722181; Sat, 21 Jan 2012 07:28:42 -0800 (PST) Received: from belanger-x100e (184-155-95-203.cpe.cableone.net. [184.155.95.203]) by mx.google.com with ESMTPS id ek6sm6673275obc.9.2012.01.21.07.28.40 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 21 Jan 2012 07:28:41 -0800 (PST) From: Jay Belanger References: <8762g8i7s6.fsf@niu.edu> <87bopz5pt8.fsf@gmail.com> <20248.39483.716850.185512@gargle.gargle.HOWL> <87d3afdlfz.fsf@gmail.com> <20249.10002.733142.491623@gargle.gargle.HOWL> <8739bajp5k.fsf@gmail.com> <20249.43656.150957.30947@gargle.gargle.HOWL> <8739bab36p.fsf@gmail.com> <20249.52946.931367.162775@gargle.gargle.HOWL> <87lip29jsn.fsf@gmail.com> <20249.58980.778477.37221@gargle.gargle.HOWL> <87r4yt9b6g.fsf@gmail.com> <20250.33882.89017.12372@gargle.gargle.HOWL> <8739b9w1vi.fsf@gmail.com> <20250.54720.342718.59012@gargle.gargle.HOWL> Date: Sat, 21 Jan 2012 09:28:38 -0600 In-Reply-To: <20250.54720.342718.59012@gargle.gargle.HOWL> (Roland Winkler's message of "Sat, 21 Jan 2012 09:12:00 -0600") Message-ID: <87vco5ulax.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.2 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Currently the latter unit conversion does require the superfluous > step that one tells Calc in one or the other way that "7" means "7 one". > I suggest that this superfluous step should not be required. Interesting point. (In your case, by the way, when the "target units must match the current units" option is chosen, the old units will never be prompted for, and "7" will automatically mean "7 one".) From unknown Fri Aug 15 20:52:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc) Resent-From: Jay Belanger Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Jan 2012 15:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10554 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "Roland Winkler" Cc: 10554@debbugs.gnu.org, jay.p.belanger@gmail.com Reply-To: jay.p.belanger@gmail.com Received: via spool by 10554-submit@debbugs.gnu.org id=B10554.132716059521884 (code B ref 10554); Sat, 21 Jan 2012 15:44:02 +0000 Received: (at 10554) by debbugs.gnu.org; 21 Jan 2012 15:43:15 +0000 Received: from localhost ([127.0.0.1]:39255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rod62-0005gv-Vv for submit@debbugs.gnu.org; Sat, 21 Jan 2012 10:43:15 -0500 Received: from mail-gx0-f172.google.com ([209.85.161.172]:40778) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rod5w-0005gc-CE for 10554@debbugs.gnu.org; Sat, 21 Jan 2012 10:43:12 -0500 Received: by ggnq4 with SMTP id q4so163618ggn.3 for <10554@debbugs.gnu.org>; Sat, 21 Jan 2012 07:42:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:reply-to:cc:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=09Jarvq9hAPaP0dC8gstu7QrpPPEHwBtaAjrrzQxJx4=; b=DiFRmwxxkCfJiKIXK0QX0vtLvZxyjX9xg2zFVAOgiXFhO/VyF70Oh8R5yS4o+6+tDA 48ioaHZIqzs69H7osjyQrc0W8lfjQV+x8/HAntYu16i+WMBqXGkYNPCHpMHP/m/w7hvJ zTBVUsppH+Q4HXkhK+i3hWkdqEk25AYJ4IoRs= Received: by 10.101.10.8 with SMTP id n8mr953423ani.86.1327160579236; Sat, 21 Jan 2012 07:42:59 -0800 (PST) Received: from belanger-x100e (184-155-95-203.cpe.cableone.net. [184.155.95.203]) by mx.google.com with ESMTPS id n24sm11318300yhj.13.2012.01.21.07.42.57 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 21 Jan 2012 07:42:58 -0800 (PST) From: Jay Belanger References: <8762g8i7s6.fsf@niu.edu> <87bopz5pt8.fsf@gmail.com> <20248.39483.716850.185512@gargle.gargle.HOWL> <87d3afdlfz.fsf@gmail.com> <20249.10002.733142.491623@gargle.gargle.HOWL> <8739bajp5k.fsf@gmail.com> <20249.43656.150957.30947@gargle.gargle.HOWL> <8739bab36p.fsf@gmail.com> <20249.52946.931367.162775@gargle.gargle.HOWL> <87lip29jsn.fsf@gmail.com> <20249.58980.778477.37221@gargle.gargle.HOWL> <87r4yt9b6g.fsf@gmail.com> <20250.33882.89017.12372@gargle.gargle.HOWL> Date: Sat, 21 Jan 2012 09:42:55 -0600 In-Reply-To: <20250.33882.89017.12372@gargle.gargle.HOWL> (Roland Winkler's message of "Sat, 21 Jan 2012 03:24:42 -0600") Message-ID: <87mx9hukn4.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) > We can define a trivial unit > > (add-to-list 'math-additional-units '(one "1" "One")) > > So every plain, dimensionless number in Calc can be converted to > ones. "7" becomes "7 one", This will automatically be done when "exact output units" option is chosen. > Calc should interpret dimensionless numbers such as "7" equivalent > to "7 one" without the need to explicitly make this trivial > conversion in either direction. ... > - If Calc finds a dimensionless number "7" on the stack, for unit > conversions it gets interpreted as "7 one" This would break current convert-units behavior, where a dimensionless number can be interpreted by the user as any unit. This is why when the user asks to convert a plain number, Calc asks for the old units. Calc was written that way on purpose, and is a feature of Calc's units handling. From unknown Fri Aug 15 20:52:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc) Resent-From: "Roland Winkler" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Jan 2012 16:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10554 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: jay.p.belanger@gmail.com Cc: 10554@debbugs.gnu.org Received: via spool by 10554-submit@debbugs.gnu.org id=B10554.132716184023697 (code B ref 10554); Sat, 21 Jan 2012 16:04:02 +0000 Received: (at 10554) by debbugs.gnu.org; 21 Jan 2012 16:04:00 +0000 Received: from localhost ([127.0.0.1]:39262 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RodQ8-0006A9-CP for submit@debbugs.gnu.org; Sat, 21 Jan 2012 11:04:00 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:43906 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RodQ6-0006A3-W5 for 10554@debbugs.gnu.org; Sat, 21 Jan 2012 11:03:59 -0500 Received: from [83.175.202.27] (port=53797 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1RodQ0-0001Tc-6t; Sat, 21 Jan 2012 11:03:55 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20250.57801.922272.839228@gargle.gargle.HOWL> Date: Sat, 21 Jan 2012 10:03:21 -0600 From: "Roland Winkler" In-Reply-To: <87mx9hukn4.fsf@gmail.com> References: <8762g8i7s6.fsf@niu.edu> <87bopz5pt8.fsf@gmail.com> <20248.39483.716850.185512@gargle.gargle.HOWL> <87d3afdlfz.fsf@gmail.com> <20249.10002.733142.491623@gargle.gargle.HOWL> <8739bajp5k.fsf@gmail.com> <20249.43656.150957.30947@gargle.gargle.HOWL> <8739bab36p.fsf@gmail.com> <20249.52946.931367.162775@gargle.gargle.HOWL> <87lip29jsn.fsf@gmail.com> <20249.58980.778477.37221@gargle.gargle.HOWL> <87r4yt9b6g.fsf@gmail.com> <20250.33882.89017.12372@gargle.gargle.HOWL> <87mx9hukn4.fsf@gmail.com> X-Mailer: VM 8.2 trial under 24.0.92.1 (x86_64-unknown-linux-gnu) X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) On Sat Jan 21 2012 Jay Belanger wrote: > > - If Calc finds a dimensionless number "7" on the stack, for unit > > conversions it gets interpreted as "7 one" > > This would break current convert-units behavior, where a dimensionless > number can be interpreted by the user as any unit. This is why when the > user asks to convert a plain number, Calc asks for the old units. Calc > was written that way on purpose, and is a feature of Calc's units > handling. That's why I said later in the email you are quoting: As discussed already, backward compatibility will require a user variable calc-treat-numbers-as-dimensional, bound to nil by default. There might be other situations where the requested treatment of dimensionless numbers implies a deviation from the current behavior Roland