Files Class List
cyCore.h File Reference

Detailed Description

Core functions and macros.

Author
Cem Yuksel

Core functions and macros for math and other common operations

#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <stdint.h>
#include <type_traits>

Common math function templates

#define CY_MEMCOPY(type, dest, source, n)   { for ( int i=0; i<(n); i++ ) (dest)[i] = (source)[i]; }
 
#define CY_MEMCONVERT(type, dest, source, n)   { for ( int i=0; i<(n); i++ ) (dest)[i] = type((source)[i]); }
 
#define CY_MEMCLEAR(type, dest, n)   memset(dest,0,(n)*sizeof(type))
 
template<typename TYPE >
TYPE cySin (TYPE a)
 
template<typename TYPE >
TYPE cyCos (TYPE a)
 
template<typename TYPE >
TYPE cyTan (TYPE a)
 
template<typename TYPE >
TYPE cyAbs (TYPE a)
 
template<typename TYPE >
TYPE cySqrt (TYPE a)
 
template<typename TYPE >
TYPE cyPow (TYPE a, TYPE e)
 
template<typename TYPE >
TYPE cyPi ()
 
template<>
float cySin< float > (float a)
 
template<>
float cyCos< float > (float a)
 
template<>
float cyTan< float > (float a)
 
template<>
float cyAbs< float > (float a)
 
template<>
float cySqrt< float > (float a)
 
template<>
float cyPow< float > (float a, float e)
 
template<>
double cyAbs (double a)