MCPcopy Create free account
hub / github.com/Aloshi/EmulationStation / getPrecedence

Method getPrecedence

src/MathExp.cpp:21–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21int MathExp::getPrecedence(const char c)
22{
23 if(c == *"(")
24 return -5;
25
26 if(c == *"+" || c == *"-")
27 return 0;
28
29 if(c == *"*" || c == *"/")
30 return 1;
31
32 std::cout << "Error - getPrecedence(): unknown character '" << c << "'\n";
33 return -1;
34}
35
36float MathExp::eval()
37{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected