Skip to content

Commit

Permalink
ConstantFloatType - fix equals()
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Apr 18, 2023
1 parent 33f4a67 commit e01ce68
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Type/Constant/ConstantFloatType.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ public function getValue(): float
return $this->value;
}

public function equals(Type $type): bool
{
return $type instanceof self && abs($this->value - $type->value) < PHP_FLOAT_EPSILON;
}

public function describe(VerbosityLevel $level): string
{
return $level->handle(
Expand Down

0 comments on commit e01ce68

Please sign in to comment.