Не пойму почему .Я уже менял // for(float a = 0; a < 8; a + 0.5) float на int и всё равно ничего не работает.
///////////////////////////////////////////////////////////////// ! - снизу меняется флоат
main.cpp:23:42: error: no matching function for call to ‘cos(float, double)’
x=(1 - 2 * pow(cos(2 * a, 2.0))) / (2 * (tg((2 * a) - (PI / 4)))) * (pow(sin((PI / 4) + (2 * b)),2.0));
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
double y; //First
const double PI = 3.14;
double x;
for(float a = 0; a < 8; a + 0.5)
for(int b = -3; b < 11; b + 0.2){
{
if (b!=-3){
if(a!=4){
x=(pow(sqrt((a-b)/(b+3)),4))+(pow(sqrt((b+a)/(a-4)),4));
}
}
else if(b >= -10){
if(b < 0){
x=(1 - 2 * pow(cos(2 * a, 2.0))) / (2 * (tg((2 * a) - (PI / 4)))) * (pow(sin((PI / 4) + (2 * b)),2.0));
////////////////////////////////// ^ - ошибка здесь ////////// ^ - и здесь
}
}
else if (b != a)
{
if(b != -a){
x=(1/(a+b))+(((2*a)-b)/(a-b))-((a+b)/1);
}
}
else
{
x=(sqrt(2-a))+((4*b)-3);
}
if(x > 12){
y = ((sqrt(abs(12 + x) - pow(x,2.0)))/(x - 11))-((sqrt(abs(12 + x) - pow(x,2.0)))/(2*x - 9));
cout << y;
}
else(x <= 12);{
y = (1 + cos(2*x - 2*PI)+cos(4*x + 2*PI) - cos(6*x - PI))/(cos(2*PI - 2*x) + (2*x + PI) - 1)- (2*cos(2*x));
}
cout << y ;
return 0;
}
}
}
main.cpp: In function ‘int main()’:
main.cpp:23:42: error: no matching function for call to ‘cos(float, double)’
x=(1 - 2 * pow(cos(2 * a, 2.0))) / (2 * (tg((2 * a) - (PI / 4)))) * (pow(sin((PI / 4) + (2 * b)),2.0));
^
In file included from /usr/include/features.h:374:0,
from /usr/include/x86_64-linux-gnu/c++/6/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/6/bits/c++config.h:507,
from /usr/include/c++/6/iostream:38,
from main.cpp:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:63:1: note: candidate: double cos(double)
__MATHCALL (cos,, (_Mdouble_ __x));
^
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:63:1: note: candidate expects 1 argument, 2 provided
In file included from /usr/include/c++/6/math.h:36:0,
from main.cpp:2:
/usr/include/c++/6/cmath:219:5: note: candidate: template constexpr typename __gnu_cxx::__enable_if::__value, double>::__type std::cos(_Tp)
cos(_Tp __x)
^~~
/usr/include/c++/6/cmath:219:5: note: template argument deduction/substitution failed:
main.cpp:23:42: note: candidate expects 1 argument, 2 provided
x=(1 - 2 * pow(cos(2 * a, 2.0))) / (2 * (tg((2 * a) - (PI / 4)))) * (pow(sin((PI / 4) + (2 * b)),2.0));
^
In file included from /usr/include/c++/6/math.h:36:0,
from main.cpp:2:
/usr/include/c++/6/cmath:211:3: note: candidate: constexpr long double std::cos(long double)
cos(long double __x)
^~~
/usr/include/c++/6/cmath:211:3: note: candidate expects 1 argument, 2 provided
/usr/include/c++/6/cmath:207:3: note: candidate: constexpr float std::cos(float)
cos(float __x)
^~~
/usr/include/c++/6/cmath:207:3: note: candidate expects 1 argument, 2 provided
main.cpp:23:75: error: ‘tg’ was not declared in this scope
x=(1 - 2 * pow(cos(2 * a, 2.0))) / (2 * (tg((2 * a) - (PI / 4)))) * (pow(sin((PI / 4) + (2 * b)),2.0));
^