Skip to content

confusion about unary_op_abs #2372

@zchrissirhcz

Description

@zchrissirhcz

functor定义:

struct unary_op_abs
{
    float operator()(const float& x) const
    {
        return abs(x);
    }
};

std::abs原型:

int       abs( int n );

unary_op_abs的目的是截断为int类型吗?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions