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
using big-integer.js gave me an answer of '18446744073709551616' no matter what I did. So I looked at other people's answers to figure out what I was doing wrong.
What I found was that other people were just subtracting 1 from the 'total' method in their answers using a variety of different fixes so I did the same. There was only one test involving the total method so all tests passed that way.
However, upon reflection, maybe the test should be fixed.
Here was my total method:
total() {
let tot = bigInt(0);
for (let i = 2; i < 65; i++) {
tot = tot + parseInt(this.square(i))
}
return bigInt(tot).minus(1).toString();
}
The .minus(1) in the second to last line was my "fix".
I found that for the test
using big-integer.js gave me an answer of '18446744073709551616' no matter what I did. So I looked at other people's answers to figure out what I was doing wrong.
What I found was that other people were just subtracting 1 from the 'total' method in their answers using a variety of different fixes so I did the same. There was only one test involving the
total
method so all tests passed that way.However, upon reflection, maybe the test should be fixed.
Here was my
total
method:The
.minus(1)
in the second to last line was my "fix".Or, if I really am supposed to get '18446744073709551615' what should I be doing instead?
My full answer is here: https://exercism.io/my/solutions/2261a8c46c844d43992a4ac2c7ba5e03
Originally posted by @beansprout in exercism/r#106 (comment)
(moved because I was in the wrong track. Oops!)
The text was updated successfully, but these errors were encountered: