Wrong EIGRP Metric calculation with floating point

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2017 03:38 AM - edited 03-08-2019 11:48 AM
Hi all,
Can someone to explain the EIGRP metric why using BW with floating point to multiply 256?
As I knew we should rounded the floating point to integer.
BW = (10000000/30000) * 256 = 333.33333333333333333333333333333 *256
#rounded the BW to 333, so 333 * 256 = 85248
Delay = (1130/10) * 256 = 28928
Metric = BW + Delay = 114176
114176 does not match to below metric.
Then I calculate again with floating point value during calculate BW, but rounded the final result to integer is match, what;s wrong?
BW = (10000000/30000) * 256 = 333.33333333333333333333333333333 *256
BW = 85333.333333333333333333333333333
Delay = (1130/10) * 256 = 28928
Metric = BW + Delay = 114261.33333333333333333333333333
- Labels:
-
Other Switching
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2017 12:00 PM
You basically never round numbers in calculation before the result, since it corrupts the values along the way and may cause a result way different than when decimal numbers or fractions are used. My guess is that EIGRP round the result for nicer output and the decimals are not needed when comparing a RD to another (the difference 0.333 when we're talking values in the million range are tiny and pointless)
