deepdiff icon indicating copy to clipboard operation
deepdiff copied to clipboard

DeepDiff significiant digit 0 is comparing digits after the decimal point

Open IntrinsicEvelyn opened this issue 1 year ago • 1 comments

Significant Digits defines the number of digits AFTER the decimal point to be used in the comparison.

When set to 0, it is still comparing after the decimal point.

d1 = 6714795744484.493
d2 = 6714795744484.502

DeepDiff(d1, d2, significant_digits=0)

Out: {'values_changed': {'root': {'new_value': 6714795744484.502,
   'old_value': 6714795744484.493}}}

Expected behavior Should not compare values after the decimal point and output { }

OS, DeepDiff version and Python version (please complete the following information):

  • OS: Windows
  • Version 10
  • Python Version 3.11.4
  • DeepDiff Version 7.0.1

IntrinsicEvelyn avatar Jun 29 '24 01:06 IntrinsicEvelyn

getting the same behavior on linux with python v3.12 and deepdiff v8.3.0. Are there any updates on this?

kristi-balla avatar Mar 10 '25 13:03 kristi-balla