Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2006-08-18 09:03:38


"Thorsten Ottosen" <nesotto_at_[hidden]> wrote in message
news:loom.20060818T123417-474_at_post.gmane.org...
> Andy Little <andy <at> servocomm.freeserve.co.uk> writes:
>
>> // Quan
>> quan::length::ft qft(3);
>> std::cout << "quan qft.numeric_value() = "<< qft.numeric_value() << '\n';
>> assert(qft.numeric_value() ==3);
>
> Just a question: why is the member called numeric_value? are there other
> values?

The function is called numeric_value as it returns the numeric value of the
quantity.

quan::length::mi my_journey(25); // distance in miles
quan::length_<int>::nm dx (25); // distance in nanometers

The numeric value of journey is 25, the numeric value of dx is 25, but the
units are very different.

See for example (in http://physics.nist.gov/cuu/pdf/sp811.pdf)

Page v, Checklist for reviewing manuscripts:

item (7)

"It is clear to which unit symbol a numerical value belongs ... etc"

item (10)

"There is a space between the numerical value and the unit .. etc"

etc.

regards
Andy Little


Boost list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk