Skip to content

Checked Subtract Support #1133

@benburk

Description

@benburk

Running the following code...

let z: Array1<u32> = arr1(&[1,0,1]) - arr1(&[0,1,0]);

...causes a panic with attempt to subtract with overflow'

Would it be possible to get support for something such as

let z: Array1<u32> =  arr1(&[1,0,1]).checked_sub(arr1(&[0,1,0])).unwrap();

or is there an alternative approach one can suggest?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions