forked from FantasqueX/Computing_Graph
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtwopn.cpp
More file actions
43 lines (43 loc) · 655 Bytes
/
twopn.cpp
File metadata and controls
43 lines (43 loc) · 655 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "twopn.h"
float sum::func(float x,float y)
{
return x+y;
}
float subtraction::func(float x,float y)
{
return x-y;
}
float multiply::func(float x,float y)
{
return x*y;
}
float division::func(float x,float y)
{
if(y==0)
{
std::cout<<"ERROR: Division by zero";
return NaN;
}
else
return x/y;
}
float EQU::func(float x,float y)
{
return float(x==y);
}
float GTR::func(float x,float y)
{
return float(x>y);
}
float GEQ::func(float x,float y)
{
return float(x>=y);
}
float LSS::func(float x,float y)
{
return float(x<y);
}
float LEQ::func(float x,float y)
{
return float(x<=y);
}