Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3046

Help needed in conversion

$
0
0
Hello,

Its been a while here now. But I had lot of help earlier.

Im facing one issue in conversion:
In the current code,
Code:

    long Xmin = -228725;
    long Ymax = 10023525;
    unsigned long uiRes = 50;
    long iXOffset = Xmin % uiRes;

iXOffset is coming as 21.

But if i change to
Code:

    long Xmin = -228725;
    long Ymax = 10023525;
    int uiRes = 50;
    long iXOffset = Xmin % uiRes;

Or
long iXOffset = Xmin % 50;

it is coming correctly as 25


Why is the current declaration of "unsigned long " causing the issue ? Please help urgently

thankyou very much
~p

Viewing all articles
Browse latest Browse all 3046

Trending Articles