From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/73091 Path: news.gmane.org!not-for-mail From: Robin Kirkham Newsgroups: gmane.comp.tex.context Subject: Re: Number formatting in \unit Date: Mon, 12 Dec 2011 11:14:52 +1100 Message-ID: <239E210D-A1AE-4A67-B664-21DD3EB001CF@csiro.au> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: multipart/mixed; boundary="===============1876350652==" X-Trace: dough.gmane.org 1323648918 4192 80.91.229.12 (12 Dec 2011 00:15:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 12 Dec 2011 00:15:18 +0000 (UTC) To: "ntg-context@ntg.nl" Original-X-From: ntg-context-bounces@ntg.nl Mon Dec 12 01:15:13 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RZtXz-0002W3-EI for gctc-ntg-context-518@m.gmane.org; Mon, 12 Dec 2011 01:15:11 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 42AE6CB16F; Mon, 12 Dec 2011 01:15:11 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 5Vn+mzOpNCgG; Mon, 12 Dec 2011 01:15:07 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 39FDDCB15C; Mon, 12 Dec 2011 01:15:07 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A3C52CB15C for ; Mon, 12 Dec 2011 01:15:05 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id rZSUhy5AI7pz for ; Mon, 12 Dec 2011 01:15:02 +0100 (CET) Original-Received: from filter4-nij.mf.surf.net (filter4-nij.mf.surf.net [195.169.124.155]) by balder.ntg.nl (Postfix) with ESMTP id 6E969CABBD for ; Mon, 12 Dec 2011 01:15:01 +0100 (CET) Original-Received: from act-MTAout4.csiro.au (act-MTAout4.csiro.au [150.229.7.41]) by filter4-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id pBC0EuaE001359 for ; Mon, 12 Dec 2011 01:14:58 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=csiro.au; i=robin.kirkham@csiro.au; q=dns/txt; s=email; t=1323648899; x=1355184899; h=from:mime-version:subject:date:in-reply-to:to:references: message-id; bh=XJ48LuVcZsSZ4t3E1SLgvkAKMQELnoUqeQ7/oBFNNow=; b=axDDGoPkfVb5I5hMVr8NsItm3o6bU7RdyI10hcnkwZ4KG11Qzy8Q/Dp3 TnKr+ZSkEnzWxAfhtNDTbgyYE3OjUis2ty+G7BK36gabcjRNthfNVe6vl hBMN+NnUYMPY6pC; X-IronPort-AV: E=Sophos;i="4.71,335,1320584400"; d="scan'208,217";a="36438741" Original-Received: from exvic-htca02.nexus.csiro.au ([138.194.81.127]) by act-ironport-int.csiro.au with ESMTP/TLS/RC4-MD5; 12 Dec 2011 11:14:53 +1100 Original-Received: from kir092m.clayton.csiro.au (138.194.25.80) by exvic-htca02.nexus.csiro.au (138.194.81.127) with Microsoft SMTP Server id 8.3.213.0; Mon, 12 Dec 2011 11:14:53 +1100 In-Reply-To: X-Mailer: Apple Mail (2.1084) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=150.229.7.41; country=AU; region=01; city=Canberra; latitude=-35.2833; longitude=149.2167; http://maps.google.com/maps?q=-35.2833,149.2167&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 04G80eU4l - dff5e4d290f4 - 20111212 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.155 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:73091 Archived-At: --===============1876350652== Content-Type: multipart/alternative; boundary="Apple-Mail-291--403174479" --Apple-Mail-291--403174479 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On 11 December 2011, Xenia wrote: > Am 11.12.2011 11:25, schrieb Robin.Kirkham@csiro.au: >> All, >>=20 >> I have put together some suggestions to extend the number formatting >> capability in \unit, particularly for scientific and engineering = purposes, >> including basic support for tolerances and uncertainties. >>=20 >> It is a bit long, so source is attached and a PDF is at >>=20 >> http://dl.dropbox.com/u/36891398/units6.pdf >>=20 >> Of course, this is just my opinion, so I welcome any feedback from = the list. >=20 > I like your suggestions. Especially the current handling of `e-23` = etc. > is not intuitive but rather confusing and does not meet the standard. >=20 > I do not know if there is already a solution for automatically > shortening the number of digits in the output, but that would be nice, = too. >=20 > Xenia Yes, I thought about that, of course, but did not put it forward because = to do it properly the correct numeric rounding/significant figures rules = should be applied, and that I guess means the Lua code needs to = interpret the number, rather than just treat it as a sequence of digits. However if the Lua code did interpret the number into an internal format = it would enable other things like normalisation to scientific or = engineering form, etc. However the internal format would have to support = arbitrarily long numbers and exponents ... Lua's built-in internal = number format (a double precision float, I think) would not do, so there = would be a bit of coding involved. Robin --Apple-Mail-291--403174479 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="us-ascii" 11 December 2011, Xenia = <yoraxe@googlemail.com>= wrote:

Am 11.12.2011 = 11:25, schrieb Robin.Kirkham@csiro.au:
All,

I have put = together some suggestions to extend the number = formatting
capability in = \unit, particularly for scientific and engineering = purposes,
including basic = support for tolerances and uncertainties.

It is a bit = long, so source is attached and a PDF is at

http://dl.dropbox.com= /u/36891398/units6.pdf

Of course, this = is just my opinion, so I welcome any feedback from the = list.

I like your suggestions. Especially the = current handling of `e-23` etc.
is not intuitive but rather confusing = and does not meet the standard.

I do not know if there is already = a solution for automatically
shortening the number of digits in the = output, but that would be nice, = too.

Xenia

Yes, I = thought about that, of course, but did not put it forward because to do = it properly the correct numeric rounding/significant figures rules = should be applied, and that I guess means the Lua code needs to = interpret the number, rather than just treat it as a sequence of = digits.

However if the Lua code did interpret = the number into an internal format it would enable other things like = normalisation to scientific or engineering form, etc. However the = internal format would have to support arbitrarily long numbers and = exponents ... Lua's built-in internal number format (a double precision = float, I think) would not do, so there would be a bit of coding = involved.

Robin

= --Apple-Mail-291--403174479-- --===============1876350652== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============1876350652==--