Re: [C++] how to use fmod in cmath library

From: Jeff Schwab (jeffplus_at_comcast.net)
Date: 03/31/04


Date: Wed, 31 Mar 2004 03:33:11 -0500

Rich GK wrote:
> Hi,
>
> The following snippet
>
> #include <cmath>
>
> float num1 = 2001.0;
> float num2 = 4.0;
> float div = std::fmod(num1 / num2); << produced the compile error

That's a syntax error. The comment sequence is "//", not "<<", which is
the left-shift or insertion operator.

> "no matching function for call"
> "candidates are float std::fmod(float, float)"
>
> Now, are these some different kinds of float the function wants (joke).

You only passed in one float, and it's value is two thousand one and
zero tenths, divided by four and zero tenths.

>
> Thanks!
> Rich G Kavanagh.
>
>
>



Relevant Pages

  • Re: [C++] how to use fmod in cmath library
    ... > Rich GK wrote: ... > the left-shift or insertion operator. ... > You only passed in one float, and it's value is two thousand one and ... > zero tenths, divided by four and zero tenths. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: XV535 carb problem cure
    ... Bending the float upward very slightly to lower ... the fuel level; bend the tang downward to raise the fuel level. ... the result with be a rich air-fuel mixture. ... The floats on both carburetors must be adjusted to the correct position to ...
    (uk.rec.motorcycles)
  • Re: 2 tables horizontally
    ... Pondering the eternal question of "Hobnobs or Rich Tea?", Tony WONG ... float: left; ...
    (alt.html)
  • Re: Do you count Dive to Atlantis at Mount Olympus as a coaster?
    ... Coasters don't float, end of discussion. ... You can add all the water to ... coaster in my opinion (and I won't count it, even if it floats for only ... I'm with you, Rich. ...
    (rec.roller-coaster)