Skip to content

DeepDiff significiant digit 0 is comparing digits after the decimal point #468

Open
@IntrinsicEvelyn

Description

@IntrinsicEvelyn

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions