summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schmidt <stefan@osg.samsung.com>2015-10-20 16:39:42 +0200
committerNicolas Aguirre <aguirre.nicolas@gmail.com>2015-11-12 10:15:03 +0100
commit8998397de3b8d4235d02a7418061a9868be2e754 (patch)
treedab10d9a6459724002dd34d0f38d4acfee5490b0
parentcc588ff87341b19056a962b19216b0909d2bf99a (diff)
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,
431 if (camera_y < 100.0) 431 if (camera_y < 100.0)
432 { 432 {
433 camera_y += 0.5; 433 camera_y += 0.5;
434 camera_z += 0.5 * (7 / 4); 434 camera_z += 0.5 * (7 / (double)4);
435 } 435 }
436 } 436 }
437 if (!strcmp(ev->key, "n")) 437 if (!strcmp(ev->key, "n"))
@@ -598,7 +598,7 @@ _create_cubes(Scene_Data *data, Evas_Real r, int count)
598 Evas_Real d_alpha; 598 Evas_Real d_alpha;
599 599
600 data->items = NULL; 600 data->items = NULL;
601 d_alpha = 360 / count; 601 d_alpha = 360 / (double)count;
602 602
603 for (i = 0; i < count; i++) 603 for (i = 0; i < count; i++)
604 { 604 {