[Bug] Double can be represented with some inaccuracy e.g. 30.0 can be
29.999999 which in case of casting to int is casted to 29 instead of 30
as expected.
[Solution] Added std round to proper round double value to closest
inteager instead of cutting of the decimal part of number.
Change-Id: I20e889df9d6a0ff4434fc18b77016287f0bd45c7
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
return result;
}
- int platform_brightness = (int)(brightness * max_brightness_);
+ int platform_brightness = std::round(brightness * max_brightness_);
if (0 == platform_brightness) {
// The value '0' on native level is treated as setting ScreenState to "SCREEN_DIM", thus the
// brightness values come from range from 1 to max_brightness_ (which is usually equal to