Skip to content

std::minus vs abs #1

@kobi-ca

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

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