elm_macros: fix for lack of precision with double due to order of operation.
authorj_yong.hwang <j_yong.hwang@samsung.com>
Tue, 4 Aug 2015 14:08:50 +0000 (16:08 +0200)
committerCedric BAIL <cedric@osg.samsung.com>
Tue, 4 Aug 2015 14:49:44 +0000 (16:49 +0200)
commitd3e047fa354f6efdc0387236dd3488d2c695e7bd
tree86c060ac05f81a577e8a48599790fb5ef3a80acc
parent560338c5c31bda8912938074cb736eabdb9f1f31
elm_macros: fix for lack of precision with double due to order of operation.

Summary:
The numerical formula below is calculated with the double type.
-> ELM_SCALE_SIZE(x) (int)(((double)(x) / elm_app_base_scale_get()) * elm_config_scale_get())

But if number of significant figure of the return value goes over 15, the epsilon error will happen.
Because of that, it is better to divide to do later.

Reviewers: woohyun, cedric

Reviewed By: cedric

Differential Revision: https://phab.enlightenment.org/D2900

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
src/lib/elm_macros.h