Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C naming conventions for numeric functions?

Say I have this function:

int epic(int);

I know of these naming conventions, are these right? Do other very common ones exist?

              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);
like image 573
orlp Avatar asked Apr 24 '26 09:04

orlp


1 Answers

Sometimes, if the return type differs 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);
like image 69
janneb Avatar answered Apr 26 '26 23:04

janneb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!