Add round to F2DOT14 inner store setter (#990)

It uses floor implicitly without it but explicit use of round will be more correct.
This commit is contained in:
Ebrahim Byagowi 2018-04-17 09:13:03 +04:30 committed by GitHub
parent 39754fb659
commit f5811bad04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -685,7 +685,7 @@ struct F2DOT14 : HBINT16
{
// 16384 means 1<<14
inline float to_float (void) const { return ((int32_t) v) / 16384.0; }
inline void set_float (float f) { v.set (f * 16384.0); }
inline void set_float (float f) { v.set (round (f * 16384.0)); }
public:
DEFINE_SIZE_STATIC (2);
};