| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Storing units in the database
Mikito Harakiri wrote:
> Marshall Spight wrote:
> >
> > I believe that C++, for example, has everything you need to
> > be able to do this sort of thing in the type system. I am
> > not aware, however, of any body of people finding it to be
> > worth the effort.
>
> Again, type system has little to offer.
>
> Adding
>
> 5 * lbs + 5 * kg
>
> is perfectly legal, although depends upon "lbs" defintion. If
>
> lbs = 0.4 * kg
>
> then we simply substitute. Then we apply distributive law. How about
> adding velocity to distance? Why not:
>
> 5 * m / c^2 + 20 * m
>
> We can apply a distributive law again
>
> (5 / c^2 + 20) * m
>
> but we fail to isolate unit symbols in a separate factor.
The C++ type system is powerful enough to
lots of work defining types, though.
Marshall Received on Tue Jul 12 2005 - 22:10:44 CDT
![]() |
![]() |