Skip to content

Instantly share code, notes, and snippets.

View cbowns's full-sized avatar

Christopher Bowns cbowns

View GitHub Profile
@cbowns
cbowns / cgfloat-64-bit-macros.h
Last active August 29, 2015 14:08 — forked from samdmarshall/gist:6891174
A collection of macros for supporting mathematic functions on both 32- and 64-bit systems.
#pragma mark -
#pragma mark CGFloat
#pragma mark Trigonometric Functions
#define CGFloatCos(a) (CGFLOAT_IS_DOUBLE ? cos(a) : cosf(a))
#define CGFloatSin(a) (CGFLOAT_IS_DOUBLE ? sin(a) : sinf(a))
#define CGFloatTan(a) (CGFLOAT_IS_DOUBLE ? tan(a) : tanf(a))
#define CGFloatACos(a) (CGFLOAT_IS_DOUBLE ? acos(a) : acosf(a))
#define CGFloatASin(a) (CGFLOAT_IS_DOUBLE ? asin(a) : asinf(a))
#define CGFloatATan(a) (CGFLOAT_IS_DOUBLE ? atan(a) : atanf(a))