Skip to content

ext/bcmath - Compares 0 and -0 as different values #17049

Closed
@SakiTakamachi

Description

@SakiTakamachi

Description

The following code:

<?php

var_dump(bccomp('0.001', '-0.001', 1));

Resulted in this output:

int(1)

But I expected this output instead:

int(0)

https://3v4l.org/fhXaL

I've identified the cause, but it's too late today so I'll fix it tomorrow...

PHP Version

PHP 8.4 >=

Operating System

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions