diff options
Diffstat (limited to 'src/vectors.c')
| -rw-r--r-- | src/vectors.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vectors.c b/src/vectors.c index 686db85..b29180b 100644 --- a/src/vectors.c +++ b/src/vectors.c @@ -108,3 +108,11 @@ void vec2_inv (vec2* v){ v->x = -v->x; v->y = -v->y; } +// test if one component of float vector is nan +inline bool vec2_isnan (vec2 v){ + return (bool)(isnanf (v.x) || isnanf (v.y)); +} +// test if one component of double vector is nan +inline bool vec2d_isnan (vec2d v){ + return (bool)(isnan (v.x) || isnan (v.y)); +} |