> On Apr 14, 2016, at 11:01 PM, Chris Lattner via swift-evolution 
> <[email protected]> wrote:
> 
> On Apr 14, 2016, at 9:49 PM, Stephen Canon <[email protected] 
> <mailto:[email protected]>> wrote:
>>> On Apr 14, 2016, at 4:55 PM, Stephen Canon via swift-evolution 
>>> <[email protected] <mailto:[email protected]>> wrote:
>>>> Provide basic constants (analogues of C's DBL_MAX, etc.)
>>> Nice, have you considered adding pi/e and other common constants?  I’d 
>>> really really like to see use of M_PI go away… :-)
>> 
>> That’s a reasonable suggestion.  I’m not sure if FloatingPoint is the right 
>> protocol to attach them to, but I’m not sure that it’s wrong either.  I’d be 
>> interested to hear arguments from the community either way.
> 
> I’m not sure where the right place is either, I just want them :-)   
> Seriously though, the notion of pi seems to make sense for both decimal and 
> binary fp types, it seems base independent.

Incidentally, if you make pi and e be static members of the type, we should get 
a pretty fluent style, along the lines of:

        let x = someDouble * 2 * .pi

I agree that there is a concern about deciding “which” constants to include.  
I’ll let you and the numeric elite figure that out :-)

-Chris

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to