| re: Problems with mod
"John Smith" <someone@microsoft.com> wrote in message
news:R2Gib.754488$YN5.707251@sccrnsc01...[color=blue]
> I'm using Microsoft Visual C++ 6.0. I've been having trouble with my %
> operator in my code; it doesn't seem to be working correctly.[/color]
Show us the code, and we'll try to sort it out.
[color=blue]
>As a test I
> typed the following in the Visual Studio quick watch window: "3400 %[/color]
1515".[color=blue]
> This evaluated to 0x000009d6 (2518 in decimal). 2518 being larger then
> 1515, this is not only an inaccurate, but invalid result![/color]
To me, "inaccurate" and "invalid" mean the same thing in
this case. :-)
[color=blue]
>Has anyone else
> seen a simalar problem?[/color]
Not I. I wrote and compiled the following with MSVC++ v6.0 SP5 :
#include <iostream>
int main()
{
std::cout << 3400 % 1515 << '\n';
return 0;
}
It gives the output:
370
When I pasted the expression '3400 % 1515' (without the
quotes) into a quick watch window and clicked the "Recalculate"
button, I got a result of 370. Perhaps you're having trouble
using your debugger, which is of course not topical here.
[color=blue]
> Is there a patch or something I need to download?[/color]
I believe the latest (and last) patch for MSVC++ v6.0
is "Service Pack 5", but I doubt this patch (or lack
of it) has anything to do with your problem (of course
I could be wrong, Microsoft has been known to do some
strange things. :-)).
-Mike |