all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Roland Winkler" <winkler@gnu.org>
To: jay.p.belanger@gmail.com
Cc: 10554@debbugs.gnu.org
Subject: bug#10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc)
Date: Fri, 20 Jan 2012 11:55:20 -0600	[thread overview]
Message-ID: <20249.43656.150957.30947@gargle.gargle.HOWL> (raw)
In-Reply-To: <8739bajp5k.fsf@gmail.com>

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





  reply	other threads:[~2012-01-20 17:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-19  5:24 bug#10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc) Roland Winkler
2012-01-19 21:45 ` Jay Belanger
2012-01-19 22:33   ` Roland Winkler
2012-01-20  4:53     ` Jay Belanger
2012-01-20  8:34       ` Roland Winkler
2012-01-20 16:48         ` Jay Belanger
2012-01-20 17:55           ` Roland Winkler [this message]
2012-01-20 19:10             ` Jay Belanger
2012-01-20 20:30               ` Roland Winkler
2012-01-20 20:54                 ` Jay Belanger
2012-01-20 22:10                   ` Roland Winkler
2012-01-21  0:00                     ` Jay Belanger
2012-01-21  9:24                       ` Roland Winkler
2012-01-21 14:45                         ` Jay Belanger
2012-01-21 15:12                           ` Roland Winkler
2012-01-21 15:28                             ` Jay Belanger
2012-01-21 15:42                         ` Jay Belanger
2012-01-21 16:03                           ` Roland Winkler
2012-01-20 20:36               ` Roland Winkler
2012-01-21  4:21 ` Jay Belanger

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20249.43656.150957.30947@gargle.gargle.HOWL \
    --to=winkler@gnu.org \
    --cc=10554@debbugs.gnu.org \
    --cc=jay.p.belanger@gmail.com \
    /path/to/YOUR_REPLY

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

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

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.