@bhavik911,
Make the same changes as in the code I shared. Also, remember double has a decimal point as well. So, long i = (2+3)/2 is 2 but double i = (2+3)/2 is 2.0. So please keep that in mind.
Test case failing
Do you think decimal might be causing issue somewhere?
I think double should not be used in this cases because decimal rounding off may cause error, is this right line of thinking?
@bhavik911,
Decimal can be a cause of issue. You won’t require double as much. Long pretty much solves all questions
Okay cool.
I just used decimal here because I was not dealing with 1 explicitly ,
you should deal with 1 explicitly
1 Like
will keep that in mind thanks