Skip to content

PHP 8.4 Incorrect result of bcdiv function. #17275

Closed

Description

@KonstantinPopov

Description

The following code:

<?php
bcdiv('0.03772321', '9650.0', 8);
bcdiv('0.03772321', '9650.0', 9); 

Resulted in this output:

"0.00003909"
"0.000003909"

But I expected this output instead:

"0.00000390"
"0.000003909"

PHP Version

PHP 8.4.2

Operating System

No response

Activity

  1. ndossche commented on Dec 26, 2024

    @ndossche
    Member

    The quotient vector has the right result, but the result is not correctly written to the bc_num character array.

  2. SakiTakamachi commented on Dec 27, 2024

    @SakiTakamachi
    Member

    Thank you!

    I've identified the cause, I'll create a PR.

  3. added a commit that references this issue on Dec 27, 2024
    ef03609
  4. added a commit that references this issue on Dec 27, 2024
    2b36680
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