Skip to content

Signed carry carrying_add in bigint_helper_methods #90541

Closed
@anisse

Description

@anisse

I had this question on the currently unreleased #![feature(bigint_helper_methods)] #85532; on signed carry (probably applies to substraction too ?); I have this test failing with the current code:

assert_eq!(i8::MAX.carrying_add(i8::MIN, true), (0, false));

Playground: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=a161cf42872e087303d1435648e6eceb

Is the test correct ? A carry did happen in an intermediate calculation, but should the overall calculation report a carry ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions