DIvision by zero should give the number divided instead an error or infinite number

  • Thread starter Thread starter wqaxs36
  • Start date Start date
W

wqaxs36

Guest
Here's why:

if (VoxCube[Voxel + _z] != 0)
{
a = ((int)VoxCube[Voxel + _x] * 1) / -(int)VoxCube[Voxel + _z];
b = ((int)VoxCube[Voxel + _y] * 1) / -(int)VoxCube[Voxel + _z];
}
else
{
a = ((int)VoxCube[Voxel + _x] * 1);
b = ((int)VoxCube[Voxel + _y] * 1);
}
It's a piece of code of a 3D engine and if I got Z coordinate equal to zero, I would like to display my object anyway ^^

Continue reading...
 
Back
Top