0

I was going through a coding competition. it asked there is decimal number and we have to find its modulo by 10^9 + 7(1000000007). the simple test cases were

  1. 1.23 should give output 110000002
  2. 4.0 should give output 4.

i was unable to understand how 1.23 can give that value. is decimal mod is treated in some different manner? not simply a remainder of a number.

ashit
  • 1
  • 3

1 Answers1

0

There is a nice explanation about the data type sizes and their problems and also how to deal with modulo of exponential sizes.

https://www.hackerearth.com/practice/notes/abhinav92003/why-output-the-answer-modulo-109-7/

Caoimhin
  • 55
  • 9
  • Hi kev, Thanks for writing back. i had already went through the formula provided there. and also implemented it. However i didnt got the desired result. however the following testcase is not successfull 1.23 should give output 110000002 – ashit Jan 05 '17 at 11:57