Skip to content

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

Closed

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

Activity

  1. self-assigned this
    on Dec 5, 2024
  2. changed the title [-]ext/bcmath - Comparison compares `0` and `-0` as different values[/-] [+]ext/bcmath - Compares `0` and `-0` as different values[/+] on Dec 5, 2024
  3. added a commit that references this issue on Dec 6, 2024
    063c3c8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions