Skip to content

fix: BinaryCalculator::product() rtrim usage (#174)#190

Open
will-b-tornsoft wants to merge 1 commit intojordanbrauer:masterfrom
will-b-tornsoft:patch-1
Open

fix: BinaryCalculator::product() rtrim usage (#174)#190
will-b-tornsoft wants to merge 1 commit intojordanbrauer:masterfrom
will-b-tornsoft:patch-1

Conversation

@will-b-tornsoft
Copy link
Copy Markdown

@will-b-tornsoft will-b-tornsoft commented Oct 31, 2025

Fixes #174

Types of changes

What types of changes does your code introduce? Check/place an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Description

Use of rtrim($value, '0.,'), causes any value of 0 to the left of the decimal (ones-place and greater) to be trimmed off due to the way rtrim repeats removal until the first non-matching character.

Motivation and Context

Fix BinaryCalculator::product() rtrim usage (#174)

Details in my comment on the issue.

How Has This Been Tested?

Locally by running tests:

php vendor/bin/pest --colors=always

@will-b-tornsoft will-b-tornsoft changed the title Fix BinaryCalculator::product() rtrim usage (#174) fix: BinaryCalculator::product() rtrim usage (#174) Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BinaryCalculator is not working in a correct way

1 participant