on Wed May 04 2016, Colin Barrett wrote:
>> Swift numeric types all currently have a family of conversion
> initializers. In many use cases they leave a lot to be
> desired. Initializing an integer type with a floating point value will
> truncate any fractional
Hi Matthew,
In general, if you think there is something to be updated in the proposal, it
is worth creating a new revision (like in the floating point protocols
proposal, for example) and mentioning it in the thread.
I think it is a way to go in this particular case, since we are still in the
Sent from my iPhone
> On May 5, 2016, at 5:19 PM, Max Moiseev via swift-evolution
> wrote:
>
> Hi all,
>
> This email is the result of a discussion between members of the standard
> library team.
>
> We suggest changing the initializers argument label to
Hi all,
This email is the result of a discussion between members of the standard
library team.
We suggest changing the initializers argument label to `exactly` to match the
one used in the floating point protocols proposal
Thanks Matthew. Personally I would really like to see an analysis of the
tradeoffs therein covered in the proposal in some way.
-Colin (via thumbs)
> On May 4, 2016, at 8:23 PM, Matthew Johnson wrote:
>
>
>>> On May 4, 2016, at 6:56 PM, Colin Barrett via
> On May 4, 2016, at 6:56 PM, Colin Barrett via swift-evolution
> wrote:
>
>> Swift numeric types all currently have a family of conversion initializers.
>> In many use cases they leave a lot to be desired. Initializing an integer
>> type with a floating point
> Swift numeric types all currently have a family of conversion initializers.
> In many use cases they leave a lot to be desired. Initializing an integer
> type with a floating point value will truncate any fractional portion of the
> number. Initializing with an out-of-range value traps.
First, a general +1 to these, thanks for proposing them.
In SE-0067 we spelled these “exactly” rather than “exact”.
init?(exactly value: Source)
As for –0, Int(exactly: -0.0) should *not* fail. My rationale for this is as
follows:
- While information (the signbit) is lost, the essential