deathbeam / maps-of-exile

PoE Maps div cards and stuff
https://mapsofexile.com/
MIT License
35 stars 3 forks source link

"Chaos per map" sometimes is wrong #25

Closed Memoframe closed 11 months ago

Memoframe commented 11 months ago

"Chaos per map" sometimes is wrong.

Steps to reproduce the behavior:

  1. Search for "The Chains that Bind"
  2. Hover over card name on each map entry that drops it.
  3. For some maps it's 1 card per 1 map; for some maps it's 1 card per 2 map. But in both cases profit per map is the same.

Expected behavior: Correct profit per map.

Desktop:

Additional context Just thoughts: maybe some weird rounding issue?

deathbeam commented 11 months ago

Yea its definitely rounding error as its a lot of floating math with very small numbers. As the site first calculates amount of drop pool items you get for your choicec and then multiples weigtht/total drop pool size with that, and total drop pool is very big so the resulting number is small.

And then I did not wanted to show partial numbers when showing cards per map so I always round up so even if the number is off by very very small floating point it gets rounded to 2.

I just went through all the cards and I did not saw it get rounded to 2 so its also probably browser or even CPU dependant. I can maybe show partial numbers instead of always rounding up and that could maybe solve it at least partially so it do not looks so off when this happens, not sure.

Memoframe commented 11 months ago

Maybe you did not find it because now there is no case where it's 1 card per 2 maps, altho few days ago there was. Anyway, it's not a big deal )