atom-community / atom-community/atom-script

Python eval() function produces wrong results

Open
#1,716 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
730
Forks
264
PR merge metrics
No merged PRs in 30d

Description

eval("(9-2x1)/5") should return 1.4 but returns 1.
eval("(9-4x1)/7") returns 0 (?).

The x substitutes the multiplications symbol because the ordinary multiplication symbol produces an italic text and is not visible.

Not sure what the problem is but should be fixed. Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.