question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

math.evaluate giving wrong answers

See original GitHub issue

When i try to use math.evaluate, it works fine when its something like 1+2, but when i do math.evaluate("12.7cm to inch") it will show this when i log it to console, image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
notlouiscommented, Apr 30, 2020

I’ve updated it just now, and sorry about the link i guess, its fair enough that you didnt want to open it, and i guess because of the domain name it could be seen as trolling

0reactions
josdejongcommented, Apr 30, 2020

@Shocks50541 you indeed have to stringify using .toString() or math.format(...).

Read more comments on GitHub >

github_iconTop Results From Across the Web

eval giving the wrong mathematical answer - MATLAB Central
I am testing as I go and I noticed that the eval command is returning the incorrect mathematical answer. I am testing it...
Read more >
Why does Python evaluate this expression incorrectly?
6 Answers 6 ... Because, in Python 2, / uses integer division when both the operator and operand are integers. ... it will...
Read more >
Why do i get the wrong answer if i evaluate the following limit ...
Your proof is wrong in going from line 2 to line 3. You say you are just using the "algebra of limits" there,...
Read more >
How To Evaluate Expressions With Variables Using Order of ...
This Pre-Algebra video tutorial explains the process of evaluating expressions with variables, fractions, and exponents.
Read more >
Evaluating Expressions and Polynomials - Purplemath
Usually the only hard part in evaluation is in keeping track of the "minus" signs. I would strongly recommend that you use parentheses...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found