Skip to content

std::minus vs abs #1

Description

@kobi-ca

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions