Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bug#1018: 23.0.60; Calculator Units Table "weirdness"

3 views
Skip to first unread message

David Hansen

unread,
Sep 23, 2008, 12:59:43 PM9/23/08
to emacs-pr...@gnu.org

Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the emacs-pr...@gnu.org mailing list.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

From the units table (u v in calc):

tsp 492892159375 10^-11 ml Teaspoon

These aren't quite friendly too

galUK 454609 10^-5 L UK Gallon
ga 980665 10^-5 m / s^2 "g" acceleration

Not sure where to draw the line, e.g. giving the exact value of c in m/s
is common, but at least the "Teaspoon" should be changed to

tsp 4.92892159375 ml Teaspoon

David

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
`bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
/home/dhansen/share/emacs/23.0.60/etc/DEBUG for instructions.


In GNU Emacs 23.0.60.3 (i686-pc-linux-gnu, GTK+ Version 2.12.11)
of 2008-09-15 on robotron
Windowing system distributor `The X.Org Foundation', version 11.0.10402000
configured using `configure '--prefix=/home/dhansen' '--disable-sound' '--disable-pop' '--without-gpm' '--without-toolkit-scroll-bars' '--with-x-toolkit=gtk''

Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: nil
locale-coding-system: utf-8-unix
default-enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
erc-list-mode: t
erc-menu-mode: t
erc-ring-mode: t
erc-pcomplete-mode: t
erc-netsplit-mode: t
erc-spelling-mode: t
erc-truncate-mode: t
erc-smiley-mode: t
erc-irccontrols-mode: t
erc-noncommands-mode: t
erc-move-to-prompt-mode: t
erc-readonly-mode: t
erc-scrolltobottom-mode: t
erc-services-mode: t
erc-networks-mode: t
erc-autojoin-mode: t
erc-track-mode: t
erc-track-minor-mode: t
erc-match-mode: t
erc-button-mode: t
erc-fill-mode: t
erc-stamp-mode: t
global-visible-mark-mode: t
which-function-mode: t
show-paren-mode: t
iswitchb-mode: t
window-number-mode: t
tooltip-mode: t
mouse-wheel-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
global-auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
abbrev-mode: 1
view-mode: t

Recent input:
<tab> p <backspace> f u <tab> <return> C-x d ~ / M
e d <tab> p <tab> <M-backspace> P <tab> i <backspace>
<return> RET C-x k <return> C-n RET C-x k <return>
C-n RET C-x k <return> C-n C-p d x y RET C-x k <return>
C-n C-p r M-f M-f M-b C-b <M-backspace> s p a c e -
o f - a i d s C-c C-c RET C-x k <return> C-n RET C-x
k <return> C-x k <return> C-x b g t <return> C-x b
g r o <return> g C-n C-n C-n C-n C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-o RET d q C-n C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-l C-n C-n
C-n RET d SPC q g C-h i m C-g d m c a l <tab> <return>
C-s u n i <return> <return> SPC SPC SPC M-x c l a <backspace>
<backspace> a l <tab> c <tab> <return> u l u C-g C-x
o C-x o C-n C-n C-n C-n M-< C-s l i s t C-a l C-n C-n
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n RET C-x
o u v C-s c u p C-n C-n C-n C-n C-n M-b C-u C-f C-u
C-f C-u C-f C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b
C-b C-f C-a M-< C-s s p p <backspace> o o n C-s C-s
C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s M-b M-b
M-b M-b M-b C-u C-f C-u C-f C-u C-f C-b C-b C-b C-b
C-b C-b C-b C-b C-b C-b C-a C-SPC C-g C-f C-a C-SPC
C-e M-w M-x r e p <tab> o r <tab> e m a <tab> b <tab>
<return>

Recent messages:
Formatting units table...done
Type M-x calc to return to the Calculator
Mark saved where search started
Mark set
Mark saved where search started
Auto-saving...done
Mark set
Quit
Mark activated
Making completion list...


Jay Belanger

unread,
Sep 24, 2008, 2:26:54 PM9/24/08
to David Hansen, emacs-pr...@gnu.org, 10...@emacsbugs.donarmstrong.com

David Hansen <david....@gmx.net> writes:
...

>>From the units table (u v in calc):
>
> tsp 492892159375 10^-11 ml Teaspoon

The values are stored that way, instead of as a float, when they are
exact.

> is common, but at least the "Teaspoon" should be changed to
>
> tsp 4.92892159375 ml Teaspoon

I'll add optional element to the `math-standard-units' entries that will
determine how to display the definition in the table, so the tsp
definition will be displayed as in the second case above. (I don't want
to change the definition or have the table display all fractions as
floats, so I'll have Calc determine how to display the entry on a case
by case basis.) Perhaps there should also be an indicator in the
displayed table telling whether the definition is exact or not.

Jay


Jay Belanger

unread,
Sep 24, 2008, 2:26:54 PM9/24/08
to David Hansen, emacs-pr...@gnu.org, 10...@emacsbugs.donarmstrong.com

Jay Belanger

unread,
Sep 24, 2008, 4:44:42 PM9/24/08
to David Hansen, emacs-pr...@gnu.org

David Hansen <david....@gmx.net> writes:
...
>> The values are stored that way, instead of as a float, when they are
>> exact.
>
> What exactly is "exact"?

"Exact" means exactly "exact". :)

> Just to be a bit pedantic: the "meter" (and therefore every measure of
> length/surface/volume) is *not* exact, it's an experimentally
> determined quantity (the length that light travels 1/299792458
> seconds).

Right, so when the Calc units table says that c = 299792458 m/s, that is
exact by definition. Many units are defined in terms of other units,
and then the values given in the units table are exact. It's only
conversions between two experimentally determined quantities (such as an
astronomical unit and a meter) that are necessarily inexact.

When the units table is displayed, having a conversion factor that is a
float indicates that it isn't exact; if conversion factors like that
between a tsp and ml are going to be displayed as a float, then there
needs to be another indicator that some values are not exact.

Jay


David Hansen

unread,
Sep 24, 2008, 3:32:15 PM9/24/08
to jay.p.b...@gmail.com, emacs-pr...@gnu.org, 10...@emacsbugs.donarmstrong.com
On Wed, 24 Sep 2008 13:26:54 -0500 Jay Belanger wrote:

> David Hansen <david....@gmx.net> writes:
> ...

>>>>From the units table (u v in calc):
>>
>> tsp 492892159375 10^-11 ml Teaspoon
>

> The values are stored that way, instead of as a float, when they are
> exact.

What exactly is "exact"? Just to be a bit pedantic: the "meter" (and


therefore every measure of length/surface/volume) is *not* exact, it's
an experimentally determined quantity (the length that light travels
1/299792458 seconds).

David


David Hansen

unread,
Sep 24, 2008, 3:32:15 PM9/24/08
to jay.p.b...@gmail.com, emacs-pr...@gnu.org, 10...@emacsbugs.donarmstrong.com

Torsten Bronger

unread,
Sep 25, 2008, 12:35:20 AM9/25/08
to emacs-pr...@gnu.org, bug-gn...@gnu.org
Hallöchen!

David Hansen writes:

> On Wed, 24 Sep 2008 13:26:54 -0500 Jay Belanger wrote:
>
>> David Hansen <david....@gmx.net> writes:
>> ...
>>>>>From the units table (u v in calc):
>>>
>>> tsp 492892159375 10^-11 ml Teaspoon
>>
>> The values are stored that way, instead of as a float, when they are
>> exact.
>
> What exactly is "exact"?

It means: the first quantity has exactly this value in terms of the
second quantity, with this number of digits, by definition.

Tschö,
Torsten.

--
Torsten Bronger, aquisgrana, europa vetus
Jabber ID: torsten...@jabber.rwth-aachen.de

Torsten Bronger

unread,
Sep 25, 2008, 12:35:20 AM9/25/08
to bug-gn...@gnu.org, emacs-pr...@gnu.org

David Hansen

unread,
Sep 25, 2008, 9:58:35 AM9/25/08
to bug-gn...@gnu.org, emacs-pr...@gnu.org
On Wed, 24 Sep 2008 15:44:42 -0500 Jay Belanger wrote:

> David Hansen <david....@gmx.net> writes:
> ...

>>> The values are stored that way, instead of as a float, when they are
>>> exact.
>>
>> What exactly is "exact"?
>

> "Exact" means exactly "exact". :)
>

>> Just to be a bit pedantic: the "meter" (and therefore every measure of
>> length/surface/volume) is *not* exact, it's an experimentally
>> determined quantity (the length that light travels 1/299792458
>> seconds).
>

> Right, so when the Calc units table says that c = 299792458 m/s, that is
> exact by definition. Many units are defined in terms of other units,
> and then the values given in the units table are exact. It's only
> conversions between two experimentally determined quantities (such as an
> astronomical unit and a meter) that are necessarily inexact.

I think I get it now. But why is "Troy ounce" or "Horsepower" marked as
inexact?

The "year" looks weird too. The only year that is 365.25d long is AFAIK
the "Julian Year" and this is *defined* to be that long.

> When the units table is displayed, having a conversion factor that is a
> float indicates that it isn't exact; if conversion factors like that
> between a tsp and ml are going to be displayed as a float, then there
> needs to be another indicator that some values are not exact.

That would be nice. The unit table is incredible important to read
cooking recipes, now imagine you make a mistake by a whole order of
magnitude :)

David


David Hansen

unread,
Sep 25, 2008, 9:58:35 AM9/25/08
to emacs-pr...@gnu.org, bug-gn...@gnu.org

Jay Belanger

unread,
Sep 25, 2008, 2:09:27 PM9/25/08
to bug-gn...@gnu.org

David Hansen <david....@gmx.net> writes:
...
> I think I get it now. But why is "Troy ounce" or "Horsepower" marked as
> inexact?

Good question. I checked the reference I used on horsepower, and it
gave several versions, some of which were listed as exact. Wikipedia
led me to the AT&T Numericana page, where an exact value of horsepower
(in terms of watts) was given. (This does not match any of the exact
values given by the Encyclopaedia of Scientific Units, alas.) The
Numericana page does mention different versions of horsepower, but
implies there's a canonical one. Perhaps this version and the metric
horsepower should both be included; they both have exact values. I'll
go through the units and double check all the approximations, putting in
the exact values when possible.

>> When the units table is displayed, having a conversion factor that is a
>> float indicates that it isn't exact; if conversion factors like that
>> between a tsp and ml are going to be displayed as a float, then there
>> needs to be another indicator that some values are not exact.
>
> That would be nice. The unit table is incredible important to read
> cooking recipes, now imagine you make a mistake by a whole order of
> magnitude :)

Sorry about that. I'll have the display fixed this weekend, or Monday
evening at the latest.

Jay

Jay Belanger

unread,
Sep 29, 2008, 10:47:47 PM9/29/08
to David Hansen, 10...@emacsbugs.donarmstrong.com

David Hansen <david....@gmx.net> writes:
...
>>From the units table (u v in calc):
>
> tsp 492892159375 10^-11 ml Teaspoon
...
> tsp 4.92892159375 ml Teaspoon

This has been fixed in CVS.
I still need to go through the units and see which additional units can
be made exact and some other tweaking, but this display weirdness has
been fixed.

Jay


0 new messages