Library submition (was: Runtime unit lib)

BCS BCS_member at pathlink.com
Sat Feb 25 09:53:02 PST 2006


In article <dtprks$1m30$1 at digitaldaemon.com>, Sai says...
>
>Great, I always wanted to write one! Actually I already have one but it is more
>like an units interpreter. However, my library has an additional feature, it 
>can take fractional powers of dimensions in p/q form where p and q are 
> integers.
>
>I am interested in adding this feature to your library, its easy. This feature
>is very useful for engineers, especially mechanical engineers where fractional
>power of dimensions appear every where. eg. time period of a simple pendulum.
>

Go ahead, fine by me. I was thinking of adding integer powers my self. One
request, I have tried to keep the unit control part as separable as possible so
that it would be easy to strip out for performance reasons.

>So, do you mind if I take a whack at it ?
>
>One question, why you left out angle and candela from fundamental units ? later
>one is used a lot in optics.
>

Each fundamental unit used adds a int to the struct and adds more overhead to
programs using this library. While not quite as handy, angles can be treated as
unit-less (IIRC SI does this) and the candela can be treated as power per area
(CGS, US and MKS do this).

>
>my units interpreter is at:
>http://mechsys4.me.udel.edu/home/banala/units.html
>
>its not very userfriendly as of yet, just ported it to D and DWT.
>
>Sai
>

This whole lib is rely a bit of a kluge because most of the time units can be
determined statically and should be checked statically. I have plans for a
template to do this but it will require implicit template specialization, so
that's on hold for now.
>In article <dto5k2$10iq$1 at digitaldaemon.com>, BCS says...
>>
>>A new version of the units lib is up at
>>
>>http://www.webpages.uidaho.edu/~shro8822/unit.d
>>
>>Several other libs are also up at:
>>
>>http://www.webpages.uidaho.edu/~shro8822/point_math.d
>>http://www.webpages.uidaho.edu/~shro8822/point_lib.d
>>
>>I would like to submit them all for inclusion in Phobos
>
>





More information about the Digitalmars-d mailing list