Package: units
Version: 1.85-3
Severity: normal

The man page explains why I have had some nasty bugs pop up in my
calculations:

       Multiplication has a higher precedence than division and is evaluated  
left  to  right,  so
       `m/s  *  s/day' is equivalent to `m / s s day' and has dimensions of 
length per time cubed.
       Similarly, `1/2 meter' refers to a unit of reciprocal length equivalent 
to .5/meter,  which
       is  probably  not  what  you would intend if you entered that 
expression.  You can indicate
       division of numbers with the vertical dash (`|').  This operator has the 
highest precedence
       so the square root of two thirds could be written `2|3^1|2'.

This is a poor choice, because algebraic notation says that division
has equal precedence to multiplication, and such operations are
performed left to right.  This is the convention used in algebra,
algebraic calculators, and most computer languages.

See http://en.wikipedia.org/wiki/Order_of_operations

Since any such change is liable to break existing units scripts, it
might be wise to make use of a commandline switch or environment
variable to switch between the historical implementation and this, if
this were to be changed.

Cute:
You have: 2/3/4
You want: 
        Definition: 0.16666667
You have: 2/3*4
You want: 
        Definition: 0.16666667


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15.1
Locale: LANG=en_AU, LC_CTYPE=en_AU (charmap=ISO-8859-1)

Versions of packages units depends on:
ii  libc6                         2.3.6-3    GNU C Library: Shared libraries an
ii  libncurses5                   5.5-1      Shared libraries for terminal hand
ii  libreadline5                  5.1-6      GNU readline and history libraries

units recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to