MCPcopy Create free account
hub / github.com/ShiqiYu/CPP / ratio

Function ratio

week14/examples/error3.cpp:6–12  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include <cmath>
5
6float ratio(float a, float b)
7{
8 if (fabs(a + b) < FLT_EPSILON)
9 throw "The sum of the two arguments is close to zero.";
10
11 return (a - b) / (a + b);
12}
13
14int main()
15{

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected