Aatch / ramp

RAMP - Rust Arithmetic in Multiple Precision
Apache License 2.0
261 stars 38 forks source link

Subtraction is backward on non-Ints #23

Closed habnabit closed 9 years ago

habnabit commented 9 years ago

A test added to int.rs:

    #[test]
    fn int_sub() {
        let l : Int = "100".parse().unwrap();
        let a : Int = "99".parse().unwrap();
        assert_mp_eq!(&l - 1, a);
    }

Fails:

---- int::test::int_sub stdout ----
    assertion failed: &l - 1 == a
thread 'int::test::int_sub' panicked at '101 != 99', src/int.rs:2972
Aatch commented 9 years ago

Well, that's embarassing. I likely made a copy-paste error when implementing the op-assign traits. Fixing it now.