comp.lang.ada
 help / color / mirror / Atom feed
From: Hyman Rosen <hyrosen@mail.com>
Subject: Re: WG: SI Units - has Ada missed the boat?
Date: Tue, 10 Jul 2007 01:26:08 GMT
Date: 2007-07-10T01:26:08+00:00	[thread overview]
Message-ID: <QeBki.3524$qu5.1837@trndny02> (raw)
In-Reply-To: <mailman.1.1183971374.3834.comp.lang.ada@ada-france.org>

Grein, Christoph (Fa. ESG) wrote:
> I don't know C++ and so I do not know how it deals mit rad, Newton
> Meters and Joule in
> 
> Work [Joule] = Torque [Newton*Meter] * Angle [rad]
> 
> Or sin x = x + x**3/3! + ... where x is in rad, sin x has dimension 1
> (not rad).
> 
> Or Bq = 1/s, Hz = 1/s, but Bq /= Hz.

Here's a description of implementing units using the
Boost Metaprogramming Library.

<http://www.boost.org/libs/mpl/doc/tutorial/dimensional-analysis.html>

I expect that most C++ implementations will follow the rule that
90% of the way is enough, and not bother with radians or trying to
distinguish between becquerel and hertz or Fahrenheit, Celsius, and
Kelvin. But if someone wants to go the whole way, they can do it.
It's just a matter of writing more complicated combining rules for
the templates. And none of it has any runtime overhead at all -
objects of dimensioned types take no more space than plain numbers.



  parent reply	other threads:[~2007-07-10  1:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-09  8:55 WG: SI Units - has Ada missed the boat? Grein, Christoph (Fa. ESG)
2007-07-09  9:49 ` Dmitry A. Kazakov
2007-07-10  1:26 ` Hyman Rosen [this message]
2007-07-10  9:14   ` Martin
2007-07-10  9:22 ` Martin
2007-07-12  1:27 ` none
2007-07-12 10:39   ` Colin Paul Gloster
2007-07-13 22:20   ` Dr. Adrian Wrigley
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox