Hello,
I'd like build my own math class library (without using cmath or other). I'm doing the division:
At the moment I'm doing operation between integer and every method ust return an integer; IDiv return the integer part if it cannot do the division; to do this I thought to exploit (int); see below:
Qt Code:
  1. int IDiv( int a, int b ) {
  2. assert (b != 0);
  3. return (int) ((float) a / (float) b);
  4. }
To copy to clipboard, switch view to plain text mode 
Is it beautiful?
Willing avoid the C/C++ math library, now I'm wonder how to do the rest of a division.....
Suggests?