From feea576130c3681239b6df50383d8fe6749ae581 Mon Sep 17 00:00:00 2001 From: Jidong Xiao Date: Fri, 15 Mar 2024 13:45:15 -0400 Subject: [PATCH] formatting --- lectures/17_exceptions/README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lectures/17_exceptions/README.md b/lectures/17_exceptions/README.md index 18817dd..4a4993d 100644 --- a/lectures/17_exceptions/README.md +++ b/lectures/17_exceptions/README.md @@ -169,10 +169,13 @@ double compute_slope(const Point &a, const Point &b) throw(int) { double rise = b.y - a.y; double run = b.x - a.x; double epsilon = 0.00001; - if (fabs(run) < epsilon) throw -1; - return rise / run; + if (fabs(run) < epsilon){ + throw -1; } - double slope(const Line &ln) { + return rise / run; +} + +double slope(const Line &ln) { return compute_slope(ln.a,ln.b); }