view test/simp1.c @ 927:b491db049d74

Added tag current-release for changeset 4e73a22327a8
author kono
date Sun, 13 Apr 2014 10:20:02 +0900
parents 5313ed059cee
children
line wrap: on
line source

int printf(const char *format, ...);


int
i(int a,int b,int c,int d,int f)
{
        printf("#0006:i(%d,%d,%d,%d,%d)\n",a,b,c,d,f);
        return a+b+c+d+f;
}

short
s(short a,short b,short c,short d,short f)
{
        printf("#0013:s(%d,%d,%d,%d,%d)\n",a,b,c,d,f);
        return a+b+c+d+f;
}

char
ch(char a,char b,char c,char d,char f)
{
        printf("#0020:ch(%d,%d,%d,%d,%d)\n",a,b,c,d,f);
        return a+b+c+d+f;
}


float
f(float a,float b,float c,float d,float f)
{
        printf("#0028:f(%g,%g,%g,%g,%g)\n",a,b,c,d,f);
        return a+b+c+d+f;
}

double
d(double a,double b,double c,double d,double f)
{
        printf("#0035:d(%g,%g,%g,%g,%g)\n",a,b,c,d,f);
        return a+b+c+d+f;
}

long long
l(long long a,long long b,long long c,long long d,long long f)
{
        printf("#0042:l(%lld,%lld,%lld,%lld,%lld)\n",a,b,c,d,f);
        return a+b+c+d+f;
}


void
i0()
{
        int a,b,c;
        a=3;
        b=-3;
        c=5;
        c = i(a*3,b*c,b+c,b/c,b-c);
        printf("#0055:int: %d\n",c);
}

void
g()
{
        float a,b,c;
        a=3.0;
        b=-3.0;
        c=5.0;
        c = f(a*3,b*c,b+c,b/c,b-c);
        printf("#0066:float: %g\n",c);
}

void
h()
{
        double a,b,c;
        a=3.0;
        b=-3.0;
        c=5.0;
        c = d(a*3,b*c,b+c,b/c,b-c);
        printf("#0077:double: %g\n",c);
}

void
h1()
{
        long long a,b,c;
        a=3;
        b=-3;
        c=5;
        c = l(a*3,b*c,b+c,b/c,b-c);
        printf("#0088:long long: %lld\n",c);
}

void
c1()
{
        char a,b,c;
        a=3;
        b=-3;
        c=5;
        c = ch(a*3,b*c,b+c,b/c,b-c);
        printf("#0099:char: %d\n",c);
}

void
s1()
{
        short a,b,c;
        a=3;
        b=-3;
        c=5;
        c = s(a*3,b*c,b+c,b/c,b-c);
        printf("#0110:short: %d\n",c);
}
int
main()
{
    i0();
    g();
    h();
    h1();
    return 0;
}