Content icon indicating copy to clipboard operation
Content copied to clipboard

std::minus vs abs

Open kobi-ca opened this issue 5 years ago • 0 comments

https://github.com/codereport/Talks/blob/741a79cc95ccfe14b5951483d563267253793065/2019-05-CppNow/AlgorithmIntuition/Slide-139.cpp#L7

You changed abs to std::minus since in abs(a-b), we know b >= a. So how changing it from abs to minus works? wouldn't this generate negative number?

Thanks, Kobi

kobi-ca avatar Dec 26 '19 21:12 kobi-ca