Re: [swift-evolution] Add max/min to floating point types

2016-06-13 Thread Stephen Canon via swift-evolution
> On Jun 10, 2016, at 5:20 PM, Darren Mo wrote: > >> – They’re not actually the maximum and minimum values of the type. In >> particular, that `max(Float.infinity, .max)` wouldn’t be `Float.max` is >> pretty seriously confusing. > > Infinity is a special value. I would

Re: [swift-evolution] Add max/min to floating point types

2016-06-13 Thread Darren Mo via swift-evolution
> On Jun 12, 2016, at 11:35 PM, Stephen Canon wrote: > > >> On Jun 10, 2016, at 5:20 PM, Darren Mo > > wrote: >> >>> – They’re not actually the maximum and minimum values of the type. In >>> particular, that `max(Float.infinity,

Re: [swift-evolution] Add max/min to floating point types

2016-06-11 Thread David Hart via swift-evolution
Agree with all you said > On 11 Jun 2016, at 02:20, Darren Mo via swift-evolution > wrote: > > Thanks for the summary of the arguments against max/min! Comments inline. > >> On Jun 10, 2016, at 6:51 PM, Stephen Canon wrote: >> >>> On Jun 10,

Re: [swift-evolution] Add max/min to floating point types

2016-06-10 Thread Darren Mo via swift-evolution
Thanks for the summary of the arguments against max/min! Comments inline. > On Jun 10, 2016, at 6:51 PM, Stephen Canon wrote: > > On Jun 10, 2016, at 12:38 PM, Xiaodi Wu via swift-evolution > > wrote: > >> On Fri,

Re: [swift-evolution] Add max/min to floating point types

2016-06-10 Thread Darren Mo via swift-evolution
Interesting. I didn’t know that you couldn’t use CGFloat.max/CGFloat.min (aka CGFloat.greatestFiniteMagnitude/CGFloat.leastNormalMagnitude) with auto layout. Good to know. However, I was not referring to auto layout, but to the calculation of text height based on a fixed width. Like: let

Re: [swift-evolution] Add max/min to floating point types

2016-06-10 Thread Xiaodi Wu via swift-evolution
On Fri, Jun 10, 2016 at 1:24 PM, Darren Mo via swift-evolution < swift-evolution@swift.org> wrote: > Today, one can get max/min by doing: > > let max = Float.greatestFiniteMagnitude > let min = -Float.greatestFiniteMagnitude > On review of the proposal for the new FloatingPoint, I too commented

Re: [swift-evolution] Add max/min to floating point types

2016-06-10 Thread Erica Sadun via swift-evolution
CGFloat has .max and .min. And if you use them, you get: 2016-06-10 13:32:14.185 Untitled Page 10[18435:13174627] This NSLayoutConstraint is being configured with a constant that exceeds internal limits. A smaller value will be substituted, but this problem should be fixed. Break on void