From 5b950dbda5098c9eae05abb7da005dda6b35f6da Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Fri, 11 Nov 2011 01:10:15 +0000 Subject: [PATCH] core: add a double complex type. --- src/matrix.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/matrix.h b/src/matrix.h index 4fbc2954..8b2c94ab 100644 --- a/src/matrix.h +++ b/src/matrix.h @@ -28,6 +28,7 @@ namespace lol template struct tname; \ typedef tname f16##suffix; \ typedef tname suffix; \ + typedef tname f64##suffix; \ typedef tname i8##suffix; \ typedef tname u8##suffix; \ typedef tname i16##suffix; \ @@ -110,10 +111,10 @@ VECTOR_TYPES(Mat4, mat4) return acc; \ } \ \ - inline float len() const \ + inline double len() const \ { \ using namespace std; \ - return sqrtf((float)sqlen()); \ + return sqrt((double)sqlen()); \ } \ \ void printf() const; @@ -446,7 +447,8 @@ static inline Quat operator /(Quat x, Quat const &y) #define SCALAR_GLOBAL2(tname, op) \ SCALAR_GLOBAL(tname, op, int) \ - SCALAR_GLOBAL(tname, op, float) + SCALAR_GLOBAL(tname, op, float) \ + SCALAR_GLOBAL(tname, op, double) #define GLOBALS(tname) \ SCALAR_GLOBAL2(tname, *) \