Skip to content

[BigInt tests] 💀 Init from float 754 - #258

Open
LiarPrincess wants to merge 4 commits into
apple:bigintegerfrom
LiarPrincess:13-Init-from-float
Open

LiarPrincess wants to merge 4 commits into
apple:bigintegerfrom
LiarPrincess:13-Init-from-float

Conversation

@LiarPrincess

Copy link
Copy Markdown

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
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant