[swift-evolution] [Proposal] Add floor() and ceiling() functions to FloatingPoint
Austin Rathe
austinr at gmail.com
Sat Jun 25 12:09:52 CDT 2016
+1 to the proposal
On Sat, 25 Jun 2016 at 17:48 David Sweeris via swift-evolution <
swift-evolution at swift.org> wrote:
>
>
>
> Sent from my iPhone
> On Jun 25, 2016, at 05:06, Karl via swift-evolution <
> swift-evolution at swift.org> wrote:
>
> Proposal: https://gist.github.com/karwa/273db66cd8a5fe2c388ccc7de9c4cf31
>
>
> +1
>
> The only thing I'm worried about is the situation where we have "x = N.M",
> and `x.ceiling` equals maybe "(N+2).0" instead of "(N+1).0" because we ran
> out of precision and can't represent (N+1).0. I'm not sure what the exact
> values are where floats (or doubles) stop having enough precision to
> represent inter-integer values... It might be a moot point.
>
> I'd suggest the functions' descriptions to be changed from
> "[largest|smallest] integral value" to "[largest|smallest] representable
> integral value".
>
> - Dave Sweeris
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160625/996a6eeb/attachment.html>
More information about the swift-evolution
mailing list