Want to know how to find Modulo of a decimal number with 10^9 + 7?

1k views Asked by At

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.

1

There are 1 answers

1
Caoimhin On

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/