हिंदी माध्यम नोट्स
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
सती रासो किसकी रचना है , sati raso ke rachnakar kaun hai in hindi , सती रासो के लेखक कौन है
सती रासो के लेखक कौन है सती रासो किसकी रचना है , sati raso ke…
21 hours ago
मारवाड़ रा परगना री विगत किसकी रचना है , marwar ra pargana ri vigat ke lekhak kaun the
marwar ra pargana ri vigat ke lekhak kaun the मारवाड़ रा परगना री विगत किसकी…
21 hours ago
राजस्थान के इतिहास के पुरातात्विक स्रोतों की विवेचना कीजिए sources of rajasthan history in hindi
sources of rajasthan history in hindi राजस्थान के इतिहास के पुरातात्विक स्रोतों की विवेचना कीजिए…
3 days ago
गुर्जरात्रा प्रदेश राजस्थान कौनसा है , किसे कहते है ? gurjaratra pradesh in rajasthan in hindi
gurjaratra pradesh in rajasthan in hindi गुर्जरात्रा प्रदेश राजस्थान कौनसा है , किसे कहते है…
3 days ago
Weston Standard Cell in hindi वेस्टन मानक सेल क्या है इससे सेल विभव (वि.वा.बल) का मापन
वेस्टन मानक सेल क्या है इससे सेल विभव (वि.वा.बल) का मापन Weston Standard Cell in…
3 months ago
polity notes pdf in hindi for upsc prelims and mains exam , SSC , RAS political science hindi medium handwritten
get all types and chapters polity notes pdf in hindi for upsc , SSC ,…
3 months ago