i want to use % (mod ) operator for a variable of type double

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sharadbags
    New Member
    • Dec 2006
    • 14

    i want to use % (mod ) operator for a variable of type double

    it is giving an error
    how do i get this operation done
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    There's a function for that: fmod(double x, double y).

    kind regards,

    Jos

    Comment

    • bluesteel
      New Member
      • Mar 2007
      • 84

      #3
      Originally posted by JosAH
      There's a function for that: fmod(double x, double y).

      kind regards,

      Jos
      And the library you have to include is math.h

      Comment

      • weaknessforcats
        Recognized Expert Expert
        • Mar 2007
        • 9214

        #4
        Mathematically speaking, the modulus operation applies only to integers.

        Comment

        Working...