Skip to content

Eydou/EvalExpr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo Evalexpr

Project made on october 2020

rating visitor badge

An essential calculator in haskell

📖 Table of Contents

Table of Contents
  1. ➤ About The Project
  2. ➤ Prerequisites
  3. ➤ Folder Structure
  4. ➤ Operators
  5. ➤ Run the Program
  6. ➤ UnitTest
  7. ➤ Results
  8. ➤ Authors

-----------------------------------------------------

📝 About The Project

This is a program named evalexpr.

This project shows how the evaluation of an arithmetic expression works by handling precedence, variables, and functions.

-----------------------------------------------------

🍴 Prerequisites

The following open source packages are used in this project:

  • Stack vers.2.13

-----------------------------------------------------

🌵 Folder Structure

code
.
 ├── app
 │   └── Main.hs
 ├── funEvalExpr.cabal
 ├── Makefile
 ├── package.yaml
 ├── src
 │   ├── Calculator.hs
 │   ├── Check.hs
 │   └── Lib.hs
 ├── stack.yaml
 ├── stack.yaml.lock
 └── unitTest
     └── unit_test.bats

-----------------------------------------------------

➕ Operators

Support:

  • + (plus)
  • - (sub)
  • * (multiplication)
  • / (division)
  • ^ (exponential)

works with () - parenthesis

-----------------------------------------------------

💻 How to run the program ?

Compile the makefile (make) and add some arithmetic expression like this !

 $> ./funEvalExpr "6 * 12 / 2 * (1 - 2 - (2 - 4 - 5) - 10) ^ 2 * (2 - 7 - 4) ^ 3"
 $> -419904.00

-----------------------------------------------------

💻 How to run the Unit Test

 > make && test_run
 
Or Put the executable in the `unitTest` folder and run like this :

 > bats unit_test.bats
 

-----------------------------------------------------

🧮 Results

Evalexpr Test
error management 100%
one single unary operator 100%
parenthesis 100%
Mixed binary operators 100%
All mixed 100%
Coding style 66.7%

-----------------------------------------------------

Authors

👦 Edouard Touch
      Email: edouard.touch@epitech.eu
      GitHub: @eydou

About

Evalexpr : Epitech project of module FUN in Haskell

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published