langleyfoxall / langleyfoxall/math_eval

Problem with simple calcul

Open
#6 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
42
Forks
6
PR merge metrics
No merged PRs in 30d

Description

Hi,

I have a problem with a simple calcul :

math_eval("0.37+0.31-0.68"), the result is "0" but the math_eval function return "-1.1102230246252E-16"

Have you an idea of the problem ?

Thanks

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start by locating the math_eval implementation and reproduce the expression 0.37+0.31-0.68 to confirm the returned value. Determine the expected precision behavior for this calculation and add or update a focused regression test showing the desired result.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.