Skip to content

Commit 4075f60

Browse files
committed
Fix NAN
1 parent 6a3e880 commit 4075f60

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Type/Visitor/Stringify.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,10 @@ public function mixedT(MixedT $type): string
448448
*/
449449
public function floatToString(float $float): string
450450
{
451+
if ($float === NAN) {
452+
return 'NAN';
453+
}
454+
451455
$string = (string) $float;
452456

453457
if (!preg_match('/\.(\d++)[eE]([+-])(\d++)/', $string, $matches)) {

0 commit comments

Comments
 (0)