summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schmidt <stefan@osg.samsung.com>2015-10-20 16:39:42 +0200
committerStefan Schmidt <stefan@osg.samsung.com>2015-10-20 16:39:42 +0200
commitdadb9fbee6f2c84e5e8867ab42df0d4d2080a7d3 (patch)
treedab10d9a6459724002dd34d0f38d4acfee5490b0
parent1d380a6d81081557ffbb1621751578042752a619 (diff)
downloadelementary-dadb9fbee6f2c84e5e8867ab42df0d4d2080a7d3.tar.gz
examples/sphere_hunter: make sure we do not loose fractional part of double.
When dividing with an int we would loose the fractional part. Better cast to a double to make clear we want double precision here. CID: 1327343, 1327344
-rw-r--r--src/examples/sphere_hunter/evas_3d_sphere_hunter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/examples/sphere_hunter/evas_3d_sphere_hunter.c b/src/examples/sphere_hunter/evas_3d_sphere_hunter.c
index 895d4f1de..e823bc3e4 100644
--- a/src/examples/sphere_hunter/evas_3d_sphere_hunter.c
+++ b/src/examples/sphere_hunter/evas_3d_sphere_hunter.c
@@ -431,7 +431,7 @@ _key_down(void *data,
if (camera_y < 100.0)
{
camera_y += 0.5;
- camera_z += 0.5 * (7 / 4);
+ camera_z += 0.5 * (7 / (double)4);
}
}
if (!strcmp(ev->key, "n"))
@@ -598,7 +598,7 @@ _create_cubes(Scene_Data *data, Evas_Real r, int count)
Evas_Real d_alpha;
data->items = NULL;
- d_alpha = 360 / count;
+ d_alpha = 360 / (double)count;
for (i = 0; i < count; i++)
{