Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BigInt tests] ❌ Unary +, - and ~ #253

Open
wants to merge 2 commits into
base: biginteger
Choose a base branch
from

Conversation

LiarPrincess
Copy link

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


❌ Failures

  func test_unaryMinus() {
    // -9223372036854775808 = Int.min
    // 'Int.min' negation overflows
    let int = -9223372036854775808
    let expected = BigInt(.positive, magnitude: BigIntPrototype.Word(int.magnitude))

    let big = -BigInt(int)
    XCTAssertEqual(big, expected)

    var negated = BigInt(int)
    negated.negate()
    XCTAssertEqual(negated, expected, "\(negated) == \(expected)")
  }

@LiarPrincess LiarPrincess changed the title # [BigInt tests] ❌ Unary +, - and ~ [BigInt tests] ❌ Unary +, - and ~ Jan 18, 2023
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