MCPcopy Create free account
hub / github.com/cutdigital/mcut / sign

Function sign

source/math.cpp:58–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56 }
57
58 sign_t sign(const double& number)
59 {
60 int s = (double(0) < number) - (number < double(0));
61 sign_t result = sign_t::ZERO;
62 if (s > 0) {
63 result = sign_t::POSITIVE;
64 } else if (s < 0) {
65 result = sign_t::NEGATIVE;
66 }
67 return result;
68
69 }
70
71 std::ostream& operator<<(std::ostream& os, const vec3& v)
72 {

Callers 3

dispatchFunction · 0.85
triangulate_faceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected