C to denote numeric functions?

Let's say I have this function:

int epic(int);


I am aware of these naming conventions, are they correct? Are there other very common ones?

              long epicl   (long);
         long long epicll  (long long);
      unsigned int epicu   (unsigned int);
     unsigned long epicul  (unsigned long);
unsigned long long epicull (unsigned long long);
            double fepic   (double);
             float fepicf  (float);



source to share

2 answers

Sometimes, if the return type is different from the argument type (s), a prefix is ​​used to indicate this. Consider for example the following (from C99):

double round(double x);
float roundf(float x);
long double roundl(long double x);

long int lround(double x);
long int lroundf(float x);
long int lroundl(long double x);

long long int llround(double x);
long long int llroundf(float x);
long long int llroundl(long double x);




Okay, you've almost summed up most of them. Some of you forgot:

long double fepicl(long double); /* thanks @pmg */
double epich(double); /* if epic is a hyperbolic function  */


On some embedded systems like ARM:

/* disclaimer, once saw them in an unofficial ARM SDK,
 * not sure if these conventions are standard */
u8 epic_8(u8);  
u16 epic_16(u16); 




All Articles