hapijs / joi

The most powerful data validation library for JS
Other
20.95k stars 1.51k forks source link

fix: Calculate multiples using two ways and take the average to adjust for floating point representation issues #2965

Closed waggonerjake closed 1 year ago

waggonerjake commented 1 year ago

Closes #2962

Marsup commented 1 year ago

Hi,

While this works, I'm wondering which method you based this patch on, do you have any academic reference that would prove this always works?

Also, I'm a bit worried about overflows, as adding big numbers can result in this scenario.

Marsup commented 1 year ago

Closing for lack of answer.