हिंदी माध्यम नोट्स
Categories: C Language in hindi
C 99 – Complex.h header file ( Part-2 ) exponentiation and power macro statement in c language in hindi
C99 हैडर फाइल Complex.h में एक्स्पोनेंसीसन और पॉवर मैक्रो स्टेटमेंट हिंदी में , C 99 – Complex.h header file ( Part-2 ) exponentiation and power macro statement in c language in hindi :-
इससे पहले वाले article मे , हमने complex.h के basic macro को पढ़ा |अब इस article मे ,exponentiation और power macro statement को पढेगे | ये सभी macro statement complex number पर ही लागु होते है |जैसे पहले वाले article मे पढ़ा की complex number तीन प्रकार के होते है :-
1. float complex
2. double complex
3.long double complex
1.Exponentiation function
1.i- Calculating Exponentiation value
इस macro ,complex number के Exponentiation value को calculate करने के किया जता है |ये तीन प्रकार के होते है |इसके syntax होते है :-
1.cexpf (float complex number );इस macro का use,float type complex number के लिए किया जाता है |
2.cexp (double complex number ); इस macro का use , double type complex number के लिए किया जाता है |
3.cexpl(long double complex number); इस macro का use , long double complex number के लिए किया जाता है |
इस macro statement मे , complex number को pass किया जाता है | और उस complex number की Exponentiation value को return होती है |
अगर complex number c=x+y.i है तब इसकी Exponentiation value = e^ x ( sin (y) + i.cos(y) ) होगी |
कुछ standard आउटपुट जो की IEEE के द्वारा suggest किये गये |
1.Exponentiation value of complex number = Exponentiation value of conjugate of complex number
2. अगर complex number 0+ 0.i या -0+0.i होगा तब Exponentiation value 1+0.i होगा |
3.अगर complex number x + infinite .i होगा तब invalid complex number का message होगा |
4.अगर complex number infinite+ y .i या -infinite +y .i होगा तब Exponentiation value +0 ( sin (y) + i.cos(y) ) होगा |
5. अगर complex number infinite + infinite .i या -infinite + infinite .i होगा तब Exponentiation value +0+0.i या +0+0.i या -0+0.i या -0 -0.i होगा |
उदाहरण होगा :
#include<stdio.h>
#include<conio.h>
#include<complex.h>
void main()
{
float real;
float imag;
float complex z ;
float complex z ;
printf(“Enter real part of complex number “);
scanf(“%.1f”,&real);
printf(“Enter imaginary part of complex number “);
scanf(“%f”,&imag);
y=CMPLXF (real , imag);
z=cexpf ( y );
z=cexpf ( y );
printf(“y= %f + %f . i”,creal(y),cimg(y));
printf(“Exponentiation value of complex number “);
printf(“e^z= %f + %f . i”,creal(z),cimg(z));
printf(“Exponentiation value of complex number “);
printf(“e^z= %f + %f . i”,creal(z),cimg(z));
getch();
}
इस उदाहरण मे , complex number ‘y’ की Exponentiation value को variable ‘z’ मे की गयी है जिसे बाद मे print किया गया है |आउटपुट होगा :
Enter real part of complex number 6
Enter imaginary part of complex number 5
y= 6 + 5 . i
Exponentiation value of complex number
z= 35.16 + 401 . i
इस उदाहरण मे , complex number ‘y’ की Exponentiation value को variable ‘z’ मे की गयी है जिसे बाद मे print किया गया है |आउटपुट होगा :
Enter real part of complex number 6
Enter imaginary part of complex number 5
y= 6 + 5 . i
Exponentiation value of complex number
z= 35.16 + 401 . i
1.ii – Calculating natural logarithm value
इस macro ,complex number के natural logarithm value को calculate करने के किया जता है |ये तीन प्रकार के होते है |इसके syntax होते है :-
1.clogf (float complex number );इस macro का use,float type complex number के लिए किया जाता है |
2.clog (double complex number ); इस macro का use , double type complex number के लिए किया जाता है |
3.clogl (long double complex number); इस macro का use , long double complex number के लिए किया जाता है |
इस macro statement मे , complex number को pass किया जाता है | और उस complex number की natural logarithm value को return होती है |
अगर complex number c=x+y.i है और इसकी polar value ( r, angle ) तब इसकी Exponentiation value = r + angle.i होगी |
कुछ standard आउटपुट जो की IEEE के द्वारा suggest किये गये |
1.natural logarithm value of complex number = natural logarithm value of conjugate of complex number
2. अगर complex number 0+ 0.i या -0+0.i होगा तब – infinite + pi.i होगा |
3.अगर complex number x + infinite .i होगा तब – infinite + ( pi.i ) / 2 होगा |
4.अगर complex number infinite+ y .i या -infinite +y .i होगा तब natural logarithm value – infinite + pi.i होगा |
5. अगर complex number infinite + infinite .i या -infinite + infinite .i होगा तब natural logarithm value +infinite + ( pi.i) / 4 होगा |
उदाहरण होगा :
#include<stdio.h>
#include<conio.h>
#include<complex.h>
void main()
{
float real;
float imag;
float complex z ;
float complex z ;
printf(“Enter real part of complex number “);
scanf(“%.1f”,&real);
printf(“Enter imaginary part of complex number “);
scanf(“%f”,&imag);
y=CMPLXF (real , imag);
z=clogf ( y );
z=clogf ( y );
printf(“y= %f + %f . i”,creal(y),cimg(y));
printf( ” Natural logarithm value of complex number “);
printf(” log (y ) = %f + %f . i”,creal(z),cimg(z));
printf( ” Natural logarithm value of complex number “);
printf(” log (y ) = %f + %f . i”,creal(z),cimg(z));
getch();
}
इस उदाहरण मे , complex number ‘y’ की natural logarithm value को variable ‘z’ मे की गयी है जिसे बाद मे print किया गया है |आउटपुट होगा :
Enter real part of complex number 6
Enter imaginary part of complex number 5
y= 6 + 5 . i
Natural logarithm value of complex number
z=
इस उदाहरण मे , complex number ‘y’ की natural logarithm value को variable ‘z’ मे की गयी है जिसे बाद मे print किया गया है |आउटपुट होगा :
Enter real part of complex number 6
Enter imaginary part of complex number 5
y= 6 + 5 . i
Natural logarithm value of complex number
z=
2.Power Function
इस macro ,complex number के उपर power को calculate करने के किया जता है |ये तीन प्रकार के होते है |इसके syntax होते है :-
1.cpowf(float complex number ,float complex number );इस macro का use, float type complex number के लिए किया जाता है |
2.cpow(double complex number , double complex number ); इस macro का use , double type complex number के लिए किया जाता है |
3.cpowl(long double complex number , long double complex number ); इस macro का use , long double complex number के लिए किया जाता है |
इस macro statement मे , दो complex numbers को pass किया जाता है | जिसमे एक base की तरह और दूसरी power की तरह कार्य करता है | दूसरी argument , नार्मल variable हो सकता है | इसमें से complex number ही pass होता है |
उदाहरण के लिए :
#include<stdio.h>
#include<conio.h>
#include<complex.h>
void main()
{
float real;
float imag;
float complex z ;
float complex h;
float complex g;
g= COPLX( 2 , 1);
float complex z ;
float complex h;
float complex g;
g= COPLX( 2 , 1);
printf(“Enter real part of complex number “);
scanf(“%.1f”,&real);
printf(“Enter imaginary part of complex number “);
scanf(“%f”,&imag);
y=CMPLXF (real , imag);
z=cpowf( y , 2.0 );
h=cpowf( y , g);
z=cpowf( y , 2.0 );
h=cpowf( y , g);
printf(“y= %f + %f . i”,creal(y),cimg(y));
printf( ” Power solution of complex number “);
printf(” power (y , 2 ) = %f + %f . i”,creal(z),cimg(z));
printf(” power (y , g ) = %f + %f . i”,creal(h),cimg(h));
printf( ” Power solution of complex number “);
printf(” power (y , 2 ) = %f + %f . i”,creal(z),cimg(z));
printf(” power (y , g ) = %f + %f . i”,creal(h),cimg(h));
getch();
}
इस उदाहरण मे,
cpowf( y , 2.0 ) : इस statement से , complex number y की power ‘2’ को solve किया गया है |
cpowf( y , g) : इस statement से , complex number ‘y’ की power complex number ‘g’ को solve किया गया है |इसका आउटपुट होगा :
Enter real part of complex number 2
Enter imaginary part of complex number 2
Power solution of complex number
power (y , 2 ) = 4 + 0.5 . i
power (y , g ) = 2 + 5 . i
इस उदाहरण मे,
cpowf( y , 2.0 ) : इस statement से , complex number y की power ‘2’ को solve किया गया है |
cpowf( y , g) : इस statement से , complex number ‘y’ की power complex number ‘g’ को solve किया गया है |इसका आउटपुट होगा :
Enter real part of complex number 2
Enter imaginary part of complex number 2
Power solution of complex number
power (y , 2 ) = 4 + 0.5 . i
power (y , g ) = 2 + 5 . i
3- Square root function
इस macro ,complex number के square root को calculate करने के किया जता है |ये तीन प्रकार के होते है |इसके syntax होते है :-
1.csqrtf ( float complex number );इस macro का use, float type complex number के लिए किया जाता है |
2.csqrt( double complex number ); इस macro का use , double type complex number के लिए किया जाता है |
3.caqrtl( long double complex number ); इस macro का use , long double complex number के लिए किया जाता है |
इस macro statement मे , complex numbers को pass किया जाता है | इसमें से complex number ही return होता है |
उदाहरण के लिए :
#include<stdio.h>
#include<conio.h>
#include<complex.h>
void main()
{
float real;
float imag;
float complex z ;
float complex z ;
printf(“Enter real part of complex number “);
scanf(“%.1f”,&real);
printf(“Enter imaginary part of complex number “);
scanf(“%f”,&imag);
y=CMPLXF (real , imag);
z=csqrtf ( y );
z=csqrtf ( y );
printf(“y= %f + %f . i”,creal(y),cimg(y));
printf( ” Square root solution of complex number “);
printf(” Square root (y) = %f + %f . i”,creal(z),cimg(z));
printf( ” Square root solution of complex number “);
printf(” Square root (y) = %f + %f . i”,creal(z),cimg(z));
getch();
}इसका आउटपुट होगा :
Enter real part of complex number 2
Enter imaginary part of complex number 2
Square root solution of complex number
Square root (y) = 1.55 + .64 . i
Enter real part of complex number 2
Enter imaginary part of complex number 2
Square root solution of complex number
Square root (y) = 1.55 + .64 . i
Recent Posts
Question Tag Definition in english with examples upsc ssc ias state pcs exames important topic
Question Tag Definition • A question tag is a small question at the end of a…
1 week ago
Translation in english grammer in hindi examples Step of Translation (अनुवाद के चरण)
Translation 1. Step of Translation (अनुवाद के चरण) • मूल वाक्य का पता करना और उसकी…
1 week ago
Report Writing examples in english grammer How to Write Reports explain Exercise
Report Writing • How to Write Reports • Just as no definite rules can be laid down…
1 week ago
Letter writing ,types and their examples in english grammer upsc state pcs class 12 10th
Letter writing • Introduction • Letter writing is an intricate task as it demands meticulous attention, still…
1 week ago
विश्व के महाद्वीप की भौगोलिक विशेषताएँ continents of the world and their countries in hindi features
continents of the world and their countries in hindi features विश्व के महाद्वीप की भौगोलिक…
1 week ago
भारत के वन्य जीव राष्ट्रीय उद्यान list in hin hindi IAS UPSC
भारत के वन्य जीव भारत में जलवायु की दृष्टि से काफी विविधता पाई जाती है,…
1 week ago