From 5b80076af20a6fe7a662442cceab318e905d74a4 Mon Sep 17 00:00:00 2001 From: IntellectualKitty Date: Mon, 8 Jun 2020 09:23:39 -0600 Subject: [PATCH] Add sqr function to CinderMath.h --- include/cinder/CinderMath.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/cinder/CinderMath.h b/include/cinder/CinderMath.h index 9de0fb53bc..e4b870a470 100644 --- a/include/cinder/CinderMath.h +++ b/include/cinder/CinderMath.h @@ -63,6 +63,7 @@ struct CI_API math } static T pow (T x, T y) {return ::pow (double(x), double(y));} static T sqrt (T x) {return ::sqrt (double(x));} + static T sqr (T x) {return x * x;} #if defined( _MSC_VER ) static T cbrt( T x ) { return ( x > 0 ) ? (::pow( x, 1.0 / 3.0 )) : (- ::pow( -x, 1.0 / 3.0 ) ); } #else @@ -99,6 +100,7 @@ struct CI_API math static float modf (float x, float *y) {return ::modff (x, y);} static float pow (float x, float y) {return ::powf (x, y);} static float sqrt (float x) {return ::sqrtf (x);} + static float sqr (float x) {return x * x;} #if defined( _MSC_VER ) static float cbrt( float x ) { return ( x > 0 ) ? (::powf( x, 1.0f / 3.0f )) : (- ::powf( -x, 1.0f / 3.0f ) ); } #else