Scalar: Changed the return type of sign, pos, pos0, neg and neg0 to int

This commit is contained in:
Henry Weller
2019-06-04 15:55:45 +01:00
parent fcbebe9eb3
commit 77f441344e

View File

@ -156,37 +156,37 @@ inline Scalar component(const Scalar s, const direction)
//- Return 1 if s is positive or 0 otherwise -1 //- Return 1 if s is positive or 0 otherwise -1
inline Scalar sign(const Scalar s) inline int sign(const Scalar s)
{ {
return (s >= 0)? 1: -1; return (s >= 0) ? 1: -1;
} }
//- Return 1 if s is positive but not 0 //- Return 1 if s is positive but not 0
inline Scalar pos(const Scalar s) inline int pos(const Scalar s)
{ {
return (s > 0)? 1: 0; return (s > 0) ? 1: 0;
} }
//- Return 1 if s is positive or 0 //- Return 1 if s is positive or 0
inline Scalar pos0(const Scalar s) inline int pos0(const Scalar s)
{ {
return (s >= 0)? 1: 0; return (s >= 0) ? 1: 0;
} }
//- Return 1 if s is negative but not 0 //- Return 1 if s is negative but not 0
inline Scalar neg(const Scalar s) inline int neg(const Scalar s)
{ {
return (s < 0)? 1: 0; return (s < 0) ? 1: 0;
} }
//- Return 1 if s is negative or 0 //- Return 1 if s is negative or 0
inline Scalar neg0(const Scalar s) inline int neg0(const Scalar s)
{ {
return (s <= 0)? 1: 0; return (s <= 0) ? 1: 0;
} }