I encountered a bug in the standard library while working on an exact 
conversion from floating point types to my rational type 
<https://gist.github.com/hooman/6e08c48e1e06ee19e06e5b09f664f9be> (when you 
pass a tolerance of zero)

SR-2868 <https://bugs.swift.org/browse/SR-2868>: If the value of the floating 
point type is a power of two, its `significandWidth` property returns a 
nonsense value, because the behavior or Builtin.int_cttz_IntNN (used in 
countTrailingZeros property) is undefined for zero. 

The test suite should have included such special cases and caught this one.

> On Oct 3, 2016, at 9:08 AM, Dave Abrahams via swift-users 
> <swift-users@swift.org> wrote:
> 
> on Sun Oct 02 2016, Hooman Mehr <swift-users-AT-swift.org 
> <http://swift-users-at-swift.org/>> wrote:
> 
>>> On Oct 2, 2016, at 5:23 PM, Dave Abrahams via swift-users 
>>> <swift-users@swift.org <mailto:swift-users@swift.org>> wrote:
>>> Presumably you mean:

_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to