ScratchData LogoScratchData
Back to NFlex23's profile

Math evaluator

NFNFlex23•Created July 9, 2021
Math evaluator
28
14
158 views
View on Scratch

Instructions

This will convert your input to postfix notation using the Shunting Yard algorithm then evaluate it using a stack machine. It supports +, -, *, /, ^, parentheses, and sin, cos, tan, asin, acos, atan, abs, sqrt, and log. The math functions have the highest precedence, so "sin 2 * 2" is the same as "sin(2) * 2". Type in your problem and press enter. When you're ready to enter another problem press space.

Description

Negative numbers must not have a space between the sign and the number or it will give you weird results. (5 - -5) not (5 - - 5).

Project Details

Project ID552045233
CreatedJuly 9, 2021
Last ModifiedAugust 18, 2022
SharedJuly 10, 2021
Visibilityvisible
CommentsAllowed