Re: [swift-evolution] Thoughts on clarity of Double and Float type names?

2016-06-21 Thread Chris Lattner via swift-evolution
> On Jun 20, 2016, at 4:22 AM, Ben Rimmington via swift-evolution > wrote: > > > > I hope it's not too late to submit a proposal. > > [stdlib/public/core/FloatingPointTypes.swift.gyb] > >

Re: [swift-evolution] Thoughts on clarity of Double and Float type names?

2016-06-21 Thread Ben Rimmington via swift-evolution
> On 20 Jun 2016, at 15:44, Stephen Canon wrote: > > At some danger of going off on a tangent, I should point out that DEC64 has > very little to recommend it. It’s not much more efficient performance-wise > than IEEE-754 decimal types and has significantly less exponent

Re: [swift-evolution] Thoughts on clarity of Double and Float type names?

2016-06-20 Thread Stephen Canon via swift-evolution
On Jun 20, 2016, at 7:22 AM, Ben Rimmington via swift-evolution wrote: > DEC64 > as the default number type! At some danger of going off on a tangent, I should point out that DEC64 has very little to recommend it. It’s not much

Re: [swift-evolution] Thoughts on clarity of Double and Float type names?

2016-06-20 Thread Ben Rimmington via swift-evolution
I hope it's not too late to submit a proposal. [stdlib/public/core/FloatingPointTypes.swift.gyb] public struct Float32: BinaryFloatingPoint public struct Float64: BinaryFloatingPoint public struct

Re: [swift-evolution] Thoughts on clarity of Double and Float type names?

2016-05-24 Thread Stephen Canon via swift-evolution
[Charlie, this is more of a reply to the thread than to your message in particular.] There is absolutely no good reason to have a “word size” floating-point type. We happen to have one on Apple systems (CGFloat), but that should be viewed as a historical curiosity, not as guidance that it’s a

Re: [swift-evolution] Thoughts on clarity of Double and Float type names?

2016-05-23 Thread Charlie Monroe via swift-evolution
In UIKit/Cocoa, there's CGFloat that does pretty much what you're asking (and it's pain working with it in Swift, since it's Double on 64-bit computers, while Swift defaults to Float, so you need casting all the time)... And I think the default behavior of Swift should be similar. I wouldn't

Re: [swift-evolution] Thoughts on clarity of Double and Float type names?

2016-05-23 Thread David Sweeris via swift-evolution
> On May 23, 2016, at 9:55 PM, Xiaodi Wu wrote: > > On Mon, May 23, 2016 at 9:40 PM, David Sweeris > wrote: > > Have we (meaning the list in general, not you & me in particular) had this > conversation before? This feels

Re: [swift-evolution] Thoughts on clarity of Double and Float type names?

2016-05-23 Thread Xiaodi Wu via swift-evolution
On Mon, May 23, 2016 at 9:40 PM, David Sweeris wrote: > On May 23, 2016, at 8:18 PM, Xiaodi Wu wrote: > > > > Int is the same size as Int64 on a 64-bit machine but the same size as > Int32 on a 32-bit machine. By contrast, modern 32-bit architectures

Re: [swift-evolution] Thoughts on clarity of Double and Float type names?

2016-05-23 Thread David Sweeris via swift-evolution
On May 23, 2016, at 8:18 PM, Xiaodi Wu wrote: > > Int is the same size as Int64 on a 64-bit machine but the same size as Int32 > on a 32-bit machine. By contrast, modern 32-bit architectures have FPUs that > handle 64-bit and even 80-bit floating point types. Therefore, it

Re: [swift-evolution] Thoughts on clarity of Double and Float type names?

2016-05-23 Thread Xiaodi Wu via swift-evolution
Int is the same size as Int64 on a 64-bit machine but the same size as Int32 on a 32-bit machine. By contrast, modern 32-bit architectures have FPUs that handle 64-bit and even 80-bit floating point types. Therefore, it does not make sense for Float to be Float32 on a 32-bit machine, as would be

Re: [swift-evolution] Thoughts on clarity of Double and Float type names?

2016-05-23 Thread David Sweeris via swift-evolution
I'd prefer they mirror the integer type naming "conventions", that is have an explicit "Float32" and "Float64" type, with "Float" being a typealias for Float64. Sent from my iPhone > On May 23, 2016, at 18:26, Adriano Ferreira via swift-evolution > wrote: > > Hi

Re: [swift-evolution] Thoughts on clarity of Double and Float type names?

2016-05-23 Thread Adriano Ferreira via swift-evolution
Hi everyone, Is there any draft/proposal related to this suggestion? Best, — A > On Jan 4, 2016, at 3:58 PM, Alex Johnson via swift-evolution > wrote: > > Hi all, > > I'm curious how other members of the Swift community feel about the clarity > of the "Double"

Re: [swift-evolution] Thoughts on clarity of Double and Float type names?

2016-01-06 Thread Stephen Canon via swift-evolution
> On Jan 6, 2016, at 3:01 AM, Goffredo Marocchi via swift-evolution > wrote: > > while it is nice at first to have a type that adapts to the device word size > it runs on, I prefer to always have an explicit accuracy guarantee than > worrying about my CGFloat code

Re: [swift-evolution] Thoughts on clarity of Double and Float type names?

2016-01-06 Thread Chris Lattner via swift-evolution
> On Jan 6, 2016, at 12:01 AM, Goffredo Marocchi wrote: > > Hello Chris, > > When dealing with floating point values, wouldn't it be in our best interest > to always be very specific about the accuracy of the floating point type > variables we use regardless of the device

Re: [swift-evolution] Thoughts on clarity of Double and Float type names?

2016-01-06 Thread Goffredo Marocchi via swift-evolution
Hello Chris, When dealing with floating point values, wouldn't it be in our best interest to always be very specific about the accuracy of the floating point type variables we use regardless of the device it runs on? This is the biggest problem I had with CGFloat: while it is nice at first to

[swift-evolution] Thoughts on clarity of Double and Float type names?

2016-01-05 Thread Alex Johnson via swift-evolution
Hi all, I'm curious how other members of the Swift community feel about the clarity of the "Double" and "Float" type names. It seems incongruous that the default type for integers is "Int", but the default type for floating point numbers is not "Float". What if the name "Float" were given to the

Re: [swift-evolution] Thoughts on clarity of Double and Float type names?

2016-01-05 Thread Goffredo Marocchi via swift-evolution
> That said, personally, my feeling is that the momentum here in the broad > family of C languages (including things like Java) is very strong, and that > diverging from that would be extremely problematic. I don’t see any “active" > problems with our current names. If this is a matter of

Re: [swift-evolution] Thoughts on clarity of Double and Float type names?

2016-01-05 Thread David Owens II via swift-evolution
+1. I think it brings a nice symmetry with the integer types and puts size classing in a more consistent place. And to be frank, I already typedef the intrinsic float/double types in my C code to f32/f64 for similar reasons. -David > On Jan 4, 2016, at 12:58 PM, Alex Johnson via

Re: [swift-evolution] Thoughts on clarity of Double and Float type names?

2016-01-05 Thread Chris Lattner via swift-evolution
On Jan 4, 2016, at 12:58 PM, Alex Johnson via swift-evolution wrote: > Hi all, > > I'm curious how other members of the Swift community feel about the clarity > of the "Double" and "Float" type names. It seems incongruous that the default > type for integers is

Re: [swift-evolution] Thoughts on clarity of Double and Float type names?

2016-01-05 Thread Paul Cantrell via swift-evolution
In principle, having Float, Float32, and Float64 and no “Double” at all seems highly sensible to me. In practice, the migration cost of changing the meaning of Float from “32-bit” to “platform preferred size” seems like a potential deal-killer. P > On Jan 5, 2016, at 2:25 PM, Alex Johnson via

Re: [swift-evolution] Thoughts on clarity of Double and Float type names?

2016-01-05 Thread Kevin Wooten via swift-evolution
>>> That said, personally, my feeling is that the momentum here in the broad >>> family of C languages (including things like Java) is very strong, and that >>> diverging from that would be extremely problematic. I don’t see any >>> “active" problems with our current names. If this is a

Re: [swift-evolution] Thoughts on clarity of Double and Float type names?

2016-01-05 Thread Stephen Canon via swift-evolution
What would this actually gain, other than most floating-point code producing different results even for basic arithmetic when run on differing platforms? Having “Int” mean “native word size” is tolerable because: (a) most integer code deals with small numbers for which the result is the same

Re: [swift-evolution] Thoughts on clarity of Double and Float type names?

2016-01-05 Thread Chris Lattner via swift-evolution
> On Jan 5, 2016, at 4:41 PM, Janosch Hildebrand via swift-evolution > wrote: > > I also think that Float and Double are not ideal type names but I also agree > with many of the concerns that have been raised. > > > Why not simply use (the existing) Float32 and