You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var incMixed = require('number-theory').incMixed;
// A number representing a mixed-radix "clock" at 11:59 PM
var number = [59, 59, 23];
// The bases for each of the mixed radix digits (60 seconds to a minute,
// 60 minutes to an hour, 24 hours to a day).
var base = [60, 60, 24];
incMixed(number, base); // Returns [0, 0, 0] (or midnight the next day)
Should return [0,0,0] but in fact returns [60, 59, 23].
I think the <= comparison on line 25 of inc-mixed should just be <.
On the same note - I feel like maybe incrementing past the point where we know the base of the next position should throw an overflow error instead of resetting back to 0. Not sure about that but something to think about.
The text was updated successfully, but these errors were encountered:
From the example:
Should return
[0,0,0]
but in fact returns[60, 59, 23]
.I think the
<=
comparison on line 25 of inc-mixed should just be<
.On the same note - I feel like maybe incrementing past the point where we know the base of the next position should throw an overflow error instead of resetting back to 0. Not sure about that but something to think about.
The text was updated successfully, but these errors were encountered: