Skip to content

Commit e01ce68

Browse files
committed
ConstantFloatType - fix equals()
1 parent 33f4a67 commit e01ce68

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Type/Constant/ConstantFloatType.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ public function getValue(): float
3838
return $this->value;
3939
}
4040

41+
public function equals(Type $type): bool
42+
{
43+
return $type instanceof self && abs($this->value - $type->value) < PHP_FLOAT_EPSILON;
44+
}
45+
4146
public function describe(VerbosityLevel $level): string
4247
{
4348
return $level->handle(

0 commit comments

Comments
 (0)