bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calc: calc-convert-temperature and floating-point results


From: Christian Schlauer
Subject: Re: Calc: calc-convert-temperature and floating-point results
Date: Sun, 26 Aug 2007 15:19:12 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Christian Schlauer <cs-muelleimer-rubbish.bin@arcor.de> writes:

> Observed with Emacs 22.1:
>
> The following table contains some temperatures in °F in the first
> column that are converted to °C in the second column with Org-mode and
> the equation below the table. The third column shows what one gets
> with Calc and `u t' (calc-convert-temperature) -- all converted
> temperatures that should be floating point numbers aren't fully
> converted: they are presented as fractions: -160:9 = -160/9 = -17.778.
>
> | T/°F |    T/°C | T/°C (calculated in Calc with `u t') |
> |------+---------+--------------------------------------|
> |    0 | -17.778 |                               -160:9 |
> |   32 |       0 |                                    0 |
> |   50 |      10 |                                   10 |
> |   70 |  21.111 |                                190:9 |
> |   90 |  32.222 |                                290:9 |
> | 98.6 |     37. |                                  37. |
> |  212 |     100 |                                  100 |
> | 1750 |  954.44 |                               8590:9 |
> #+TBLFM: $2=($1-32)*5/9

This has been dealt with on the trunk -- thanks, Jay! However, it
doesn't work all the time. In fact, it seems to work only the first
time:

1. emacs -q --no-site-file
2. M-x calc
3. '0 dF RET
4. u t dF RET dC RET

So far, so good. But try to convert one more temperature:

5. '50 dF RET
6. u t RET

Now Emacs beeps and the echo area says "Bad format in units
expression: Expected a number".

Besides that, shouldn't this go into EMACS_22_BASE as well? -160:9
(°C) isn't a really convenient representation of -17.778 (°C), so it
counts as a bug fix, IMO.

> P. S.: May I add a feature request? It would be nice if
> calc-convert-temperature (and calc-convert-units) remembered the last
> `target unit' requested by the user.

Thanks for implementing this!
-- 
Christian Schlauer





reply via email to

[Prev in Thread] Current Thread [Next in Thread]