Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

5
Is it possible to build a calculator using entirely functional programming?
Post Body

I'm working on the Odin Project's calculator, and it got me wondering: would it be possible to build the calculator using entirely functional programming?

I had a thought of using a memory array to hold numbers, then calling reduce against the array with the different operations set up as reduce functions.

However, the bits I'm struggling with are:

  1. How to parse out the actual operations.

  2. How to handle decimals.

  3. How to handle double and triple-digit numbers.

If anyone has any good jumping-off points for those three, I'd be very appreciative.

Author
Account Strength
90%
Account Age
4 years
Verified Email
Yes
Verified Flair
No
Total Karma
1,293
Link Karma
1,040
Comment Karma
240
Profile updated: 4 hours ago
Posts updated: 11 hours ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
4 years ago