Skip to content

Commit

Permalink
avoid integer division
Browse files Browse the repository at this point in the history
The type of the numerator and the denumerator are both integer/unsigned
integer. Therefore, the division operator corresponds to integer division. This
commit makes the numerator a double to get the expected result.
  • Loading branch information
michael-hartmann committed Jan 13, 2019
1 parent 2c914a3 commit 5061045
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/source/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The matrix that needs to be solved for is abstracted through this derived class

dtype getMatrixEntry(int i, int j)
{
return (1 / (i + j + 1));
return (1. / (i + j + 1));
}
}

Expand Down

0 comments on commit 5061045

Please sign in to comment.