System.Math.DivRem for compact framework

  • Thread starter Thread starter muzilli
  • Start date Start date
M

muzilli

Howdy all,

what is the same DivRem function for Mobile development. I'm using the
..NET compact framework.

Thanks all,

Marcelo Muzilli
 
Howdy all,

what is the same DivRem function for Mobile development. I'm using the
.NET compact framework.

Thanks all,

Marcelo Muzilli

If it's not supported by the CF, then you will have to use a
combination of Integer division and Mod to obtain the same result.
 
Thanks Chris for the quick response.
If it's not supported by the CF, then you will have to use a
combination of Integer division and Mod to obtain the same result.

In my line:

System.Math.DivRem(this.BlockCounter, 2, out Result);

Can you help me with the solution?

Thanks,

MM
 
Is this correct?

double Result;
// System.Math.DivRem(this.BlockCounter, 2, out Result);
Result = (this.BlockCounter % 2);

Many thanks,

MM
 
Is this correct?

double Result;
// System.Math.DivRem(this.BlockCounter, 2, out Result);
Result = (this.BlockCounter % 2);

Many thanks,

MM

The mod operator (%) will give you the remainder, but for the quotient
portion of it you would have to also do a divide operation. You have
to do both to emulate the behavior of the DivRem method since that
method returns both a quotient and a remainder.
 
Back
Top