Is there a reason usize is not used for the return type? It seems more natural if we're going to do conversions anyways, since a negative value is meaningless. Plus now there are situations where we can't give the correct answer. [i16::MIN, i16::MAX] would product an answer of 2^16 - 2, which is way to big to fit in an i16. I guess if we're going for minmalism u16 would be the appropriate type, but would require more conversion unless the input was also &[u16].
In rust 8.0 / 30.0 * 100.0 returns 26.666666666666668 which makes the test fail since merr is set to -12 (and description mentions precision should be -9)
Already approved by someone.
Is there a reason
usize
is not used for the return type? It seems more natural if we're going to do conversions anyways, since a negative value is meaningless. Plus now there are situations where we can't give the correct answer.[i16::MIN, i16::MAX]
would product an answer of2^16 - 2
, which is way to big to fit in ani16
. I guess if we're going for minmalismu16
would be the appropriate type, but would require more conversion unless the input was also&[u16]
.Approved by someone
Approved by someone
Approved by someone
In rust 8.0 / 30.0 * 100.0 returns 26.666666666666668 which makes the test fail since merr is set to -12 (and description mentions precision should be -9)
Approved by someone
Approved
Approved :)
Approved by author!
Now needs update to 1.60...
approved by someone
missed this, now language version is off, can you update?
Approved by someone
Loading more items...