diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2024-01-20 03:43:18 +0200 |
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2024-01-28 23:28:39 +0200 |
| commit | 20fe60f40d80634dd22dd2b85b4b14c86b7dc927 (patch) | |
| tree | 8224950788e5e9803c19b26b4aeb62c415d364ba /zebra/interface.c | |
| parent | 0a5b944aefdcc7da75bf383ea3f82bed562f1c12 (diff) | |
lib: fix conversion of yang decimal64 to double
Current denominators are not integers and some of them lose precision
because of that, for example, 1e-6 is actually stored as
9.9999999999999995e-07 and 1-e12 is stored as 9.9999999999999998e-13.
When multiplying by such denominators, we receive incorrect values.
Changing denominators to integers and using division instead of
multiplication improves precision and solves the problem.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'zebra/interface.c')
0 files changed, 0 insertions, 0 deletions
