From 5061045530c358ac9a9476e7f5a98ddfbddfa10e Mon Sep 17 00:00:00 2001 From: Michael Hartmann Date: Sun, 13 Jan 2019 11:41:29 +0100 Subject: [PATCH] avoid integer division 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. --- docs/source/tutorial.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/tutorial.rst b/docs/source/tutorial.rst index 89d1cc8..0a9b582 100644 --- a/docs/source/tutorial.rst +++ b/docs/source/tutorial.rst @@ -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)); } }