This method is a *lot* faster than using (int)Math.floor(x)
| 64 | |
| 65 | // This method is a *lot* faster than using (int)Math.floor(x) |
| 66 | static inline int32_t fastfloor(double fp) { |
| 67 | int32_t i = static_cast<int32_t>(fp); |
| 68 | return (fp < i) ? (i - 1) : (i); |
| 69 | } |
| 70 | |
| 71 | double dot(Grad g, double x, double y) { |
| 72 | return g.x*x + g.y*y; |
nothing calls this directly
no outgoing calls
no test coverage detected