php / php/php-src

bcmath functions to support scientific notation numbers

Open
#17,876 3 comments 1 reaction 1 assignee View on GitHub

@SakiTakamachi is already working on this.

Since Feb 22, 2025.

Extension: bcmath Feature Status: Requires RFC
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

I occurred a problem with bcmath functions, bcadd, bcround specifically, where they do not support scientific notation numbers, for example 2.3314683517128E-14.

A solution that I found online was to use as bcround(sprintf("%.20f", (float)$rest['nett']), 9), but it is a bit hard to do that everywhere.

Wouldn't it be more logical for bc* functions to support 2.3314683517128E-14 since they support 0.0000000000000023314683517128 for example

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.