Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | James Kuyper <jameskuyper@verizon.net> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Structure without a tag |
| Date | 2011-10-18 07:10 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <j7jms3$lbb$1@dont-email.me> (permalink) |
| References | (4 earlier) <j7flu0$5su$1@dont-email.me> <j7frga$8ou$1@dont-email.me> <20111017125705.251@kylheku.com> <4E9C6BA2.2030504@verizon.net> <X9GdnYxKQKO5rgDTnZ2dnUVZ_s-dnZ2d@posted.internetamerica> |
The last time I had to remind you of this was March 31st. Permission to
quote any part of any message I post, without proper attribution, is
denied. Your unjustified fear of being held responsible for falsely
attributing quoted text to someone using a spoofed user id doesn't
excuse you from your responsibility for properly attributing quotations.
On 10/18/2011 04:04 AM, Gordon Burditt wrote:
>> You could impose such a rule if you want, but it's not a standard part
>> of the general concept of unit conversions. There's no inherent reason
>> why such a product could not be meaningful - a quantity with those units
>> it might occur as one of the coefficients in the equation describing a
>> curve that has been fitted to data connecting the voltage applied to an
>> electric oven to the number of calories in the resulting cookies.
>
> There is not anything necessarily wrong with doing that multiplication,
> but when you assign the result of it to a variable with incompatible
> units, the compiler could raise an error.
That's why I listed assignment as one of the contexts where there is a
constraint requiring matching units (for those entering this discussion
late, I'm not talking about a C constraint; just a requirement for the
calculation to be meaningful).
...
> One problem this brings up is that you need to support constants
> with units, and the physics book wasn't always careful to put units
> on its constants. Formulas you find elsewhere are even less likely
> to identify the units involved, but just state the units of all the
> variables and the result.
Two of the key things I learned in physics classes at Caltech were the
importance of associating both units and uncertainties with every
quantity. My real world experience has been that the actual scientists I
work with are extraordinarily lax about such things, which often causes
problems.
Two weeks ago I asked someone to determine whether there was any
evidence of a significant impact on the accuracy of our measurements
correlated with a particular event. Yesterday, I got a response that was
just a bunch of raw numbers, with no uncertainties, and not even a
qualitative assessment of their significance. I asked him, to at least
give me a statement about whether or not he thought it was significant.
His response was more numbers: comparable figures from last year, again
with no uncertainties and no verbal assessment of the significance of
the difference between last year's figure and this year's. I don't have
the authority to insist that he give me a more useful response, and I
have neither the data nor the time required to do that analysis myself.
I suspect he doesn't really understand what the term "statistically
significant" means. I had to tell our client "we don't know".
> Another problem is that you really need to handle unit-generic
> routines, like printf() and strtod(). Quick, what's the printf
> format for a floating point number in furlongs per fortnight?
In a C-like system where types had units attached, printf("%f") would
need to be able to print any type whose promoted type is based upon
double, regardless of units. There would also be a need for some
mechanism for accessing a string representing the units - perhaps a
_unitsof operator, analogous to sizeof?
> I suppose some applications will demand that you add 'currency' as
> a 6th fundamental unit. ...
No, you need a different unit for each currency.
A unit-based system will be nearly useless unless arbitrary user-defined
units can be defined. Chemical calculations, for instance, often need to
distinguish between "moles of Carbon atoms" and "moles of Hydrogen
atoms". You'd better NOT cancel those out just because they're both
moles - you need to apply a context-specific conversion factor, such as
4 Hydrogen atoms/Carbon atom, for Methane, in order to get proper
cancellation.
In other contexts, units of "cookies" or "divisions" or "tables" might
be appropriate.
...
> Then we were introduced to the "CGS" system (centimeter, gram,
> second), which somehow managed to call the speed of light a
> dimensionless constant of 1. I never did like that.
The CGS system does not make the speed of light 1. You're thinking of
Plank units. They're very convenient when you would otherwise find
yourself using equations with a lot of 'c's in them, but the absence of
units can make it easy to get lost in such calculations.
--
James Kuyper
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Structure without a tag Максим Фомин <maxim@maxim-fomin.ru> - 2011-10-15 13:20 -0700
Re: Structure without a tag Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-10-15 17:16 -0400
Re: Structure without a tag Frederick Williams <freddywilliams@btinternet.com> - 2011-10-16 15:19 +0100
Re: Structure without a tag Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-10-16 10:30 -0400
Re: Structure without a tag Keith Thompson <kst-u@mib.org> - 2011-10-16 13:54 -0700
Re: Structure without a tag Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-10-16 22:09 +0000
Re: Structure without a tag Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-10-16 18:29 -0400
Re: Structure without a tag "BartC" <bc@freeuk.com> - 2011-10-16 23:55 +0100
Re: Structure without a tag blp@cs.stanford.edu (Ben Pfaff) - 2011-10-16 17:31 -0700
Re: Structure without a tag James Kuyper <jameskuyper@verizon.net> - 2011-10-16 20:05 -0400
Re: Structure without a tag Kaz Kylheku <kaz@kylheku.com> - 2011-10-17 17:02 +0000
Re: Structure without a tag James Kuyper <jameskuyper@verizon.net> - 2011-10-17 13:53 -0400
Re: Structure without a tag Robert Wessel <robertwessel2@yahoo.com> - 2011-10-17 13:38 -0500
Re: Structure without a tag Максим Фомин <maxim@maxim-fomin.ru> - 2011-10-17 22:28 -0700
Re: Structure without a tag gordonb.b1148@burditt.org (Gordon Burditt) - 2011-10-18 03:04 -0500
Re: Structure without a tag Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-10-18 01:37 -0700
Re: Structure without a tag James Kuyper <jameskuyper@verizon.net> - 2011-10-18 07:10 -0400
Re: Structure without a tag gwowen <gwowen@gmail.com> - 2011-10-18 08:43 -0700
Re: Structure without a tag James Kuyper <jameskuyper@verizon.net> - 2011-10-18 11:55 -0400
Re: Structure without a tag "BartC" <bc@freeuk.com> - 2011-10-18 17:18 +0100
Re: Structure without a tag Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2011-10-18 15:09 -0600
Re: Structure without a tag Patrick Scheible <kkt@zipcon.net> - 2011-10-18 08:59 -0700
Re: Structure without a tag James Kuyper <jameskuyper@verizon.net> - 2011-10-18 12:54 -0400
Attributions (was Re: Structure without a tag) Keith Thompson <kst-u@mib.org> - 2011-10-18 11:48 -0700
Re: Structure without a tag Stephen Sprunk <stephen@sprunk.org> - 2011-10-18 16:20 -0500
Re: Structure without a tag Tim Rentsch <txr@alumni.caltech.edu> - 2012-01-24 18:05 -0800
Re: Structure without a tag Keith Thompson <kst-u@mib.org> - 2011-10-15 16:30 -0700
Re: Structure without a tag Jean-Christophe <5.d@free.fr> - 2011-10-16 09:54 -0700
csiph-web