Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
13
Task/Exponentiation-operator/C/exponentiation-operator-2.c
Normal file
13
Task/Exponentiation-operator/C/exponentiation-operator-2.c
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#define generic_pow(base, exp)\
|
||||
_Generic((base),\
|
||||
double: dpow,\
|
||||
int: ipow)\
|
||||
(base, exp)
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("2^6 = %d\n", generic_pow(2,6));
|
||||
printf("2^-6 = %d\n", generic_pow(2,-6));
|
||||
printf("2.71^6 = %lf\n", generic_pow(2.71,6));
|
||||
printf("2.71^-6 = %lf\n", generic_pow(2.71,-6));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue