Positive

dsimcha dsimcha at yahoo.com
Sat Oct 4 21:34:03 PDT 2008


== Quote from Andrei Alexandrescu (SeeWebsiteForEmail at erdani.org)'s article
> Jason House wrote:
> > Andrei Alexandrescu Wrote:
> >> Positive.(real) sqrt(Positive.(real) x);
> >
> > Ummm... That's not even the correct signature for square root. It
> > should accept non negative numbers.
> Rats. I was thinking positive means >= 0 and strictly positive means >
> 0. According to Wikipedia, positive really means strictly positive and
> the longer-to-type NonNegative should be used instead :o|. For such a
> simple concept, a short and sweet name is pivotal. If there are any
> ideas for a better choice, please make them known.
> Andrei

Maybe create the templates as a back end using whatever name, and then create
typedefs/aliases for ufloat, udouble, ureal?  This would definitely be consistent
with ints and easy to remember.



More information about the Digitalmars-d mailing list