Skip to content

Does math operations in order of left to right, completely ignoring PEMDAS or the Order of Operations.

Notifications You must be signed in to change notification settings

wetbadger/simpleMath

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 

Repository files navigation

simpleMath.py

Simple calculator for doing math left to right

This module is designed to do math from left to right ignoring order of operations. The purpose of this is to prove that PEMDAS also known as Please Excuse My Dear Aunt Sally, also known as Parenthesis Exponents Multiplication Division Addition Subtraction is unnecessary and all math could be done virtually without parenthesis if problems were solved left to right.

Rather than building a calculator from scratch, this forces python to do the operations in order of left to right.

LICENSE: This is open-source software released under the terms of the GPL (http://www.gnu.org/licenses/gpl.html).

EXAMPLE:


import simpleMath

answer = simpleMath.solve("4 + 2 * 3")

print(answer)

OUTPUT:
18

OVERVIEW: When entering a problem into simpleMath.solve(string), the problem should be expressed as a string. Any amount of whitespace is ignored. And Python is forced to do operations from left to right.

About

Does math operations in order of left to right, completely ignoring PEMDAS or the Order of Operations.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages