logarithmic functions with complex numbers in c 2fc 2b 2b

Solutions on MaxInterview for logarithmic functions with complex numbers in c 2fc 2b 2b by the best coders in the world

showing results for - "logarithmic functions with complex numbers in c 2fc 2b 2b"
Carolina
30 Aug 2016
1#include "stdafx.h"
2#include "calc.h"
3
4void complex_log(double a, double b) {
5	if (b == 0 && a > 0) {
6		resultR = ln(a);
7		resultI = 0;
8	}
9	else {
10		if (a >= mINF && a <= INF && b >= mINF && b <= INF) {
11			resultR = 0; resultI = 0;
12			resultR = ln(pot(pot(a, 2.0, 1) + pot(b, 2.0, 1), 0.5, 1));
13			resultI = atan2(b, a);
14		}
15		else {
16			if (rasf > 0) {
17				printf("\nError in function domain.\n\n ==> For complex natural logarithm function the valid domain is [-INF, INF].\n\n");
18				printf(" ==> Your function argument: ");
19				complexNumber(a, b);
20			}
21		}
22	}
23}
24
25double ln(double z) {
26	double result1 = 0;
27	result1 = log10(z) / log10(M_E);
28	return result1;
29}