README
Compare within margin
Description
Create a function close_compare that accepts 3 parameters:
a, b, and an optional margin.
The function should return whether a is lower than, close to,
or higher than b.
Please note the following
When
ais close tob, return0.For this challenge,
ais considered “close to”bifmarginis greater than or equal to the absolute distance betweenaandb.
Otherwise…
When
ais less thanb, return-1.When
ais greater thanb, return1.
If margin is not given, treat it as if it were zero.
Assume: margin >= 0
Tip: Some languages have a way to make parameters optional.