How to use % operator for float values in c

前端 未结 6 472
故里飘歌
故里飘歌 2020-12-03 14:30

When I use % operator on float values I get error stating that \"invalid operands to binary % (have ‘float’ and ‘double’)\".I want to enter the integers value only but the n

6条回答
  •  生来不讨喜
    2020-12-03 15:29

    consider : int 32 bit and long long int of 64 bits

    Yes, %(modulo) operator isn't work with floats and double.. if you want to do the modulo operation on large number you can check long long int(64bits) might this help you.

    still the range grater than 64 bits then in that case you need to store the data in .. string and do the modulo operation algorithmically.

    or either you can go to any scripting language like python

提交回复
热议问题