swift-numerics icon indicating copy to clipboard operation
swift-numerics copied to clipboard

[BigInt tests] 💀 Init from float 754

Open LiarPrincess opened this issue 2 years ago • 0 comments
trafficstars

Please read the #242 Using tests from “Violet - Python VM written in Swift” before.


💀 Crash

func test_initFromFloat_crash() {
  // 9223372036854775808 = UInt64(1) << Float80.significandBitCount
  let int: UInt64 = 9223372036854775808
  let big = BigInt(int)
  let fromInt = Float80(exactly: int) // works
  let fromBigInt = Float80(exactly: big) // crash
}

LiarPrincess avatar Feb 03 '23 13:02 LiarPrincess