Hi all, I am trying to create a program which computes the function.I tried to take only the integers from ,for example, 1.4 to 5.9 but it dont works.
Any help will be appreciated.
yes, at first they were integers, but when i saw the errors i turned them into doubles.the problem is that when i make them integers , in the loop 'a' is double,
Provide a test case; int min = 0, max = 0; Instead of that, initialize them with the first result from the function (or std::numeric_limits<int>::min(), std::numeric_limits<int>::max()
I get the following errors when compiling your code:
badcode.cpp: In function ~int main()~:
badcode.cpp:30: warning: converting to ~int~ from ~double~
badcode.cpp:32: warning: converting to ~int~ from ~double~
badcode.cpp:36: error: ~y~ was not declared in this scope
badcode.cpp:41: error: invalid operands of types ~double~ and ~<unknown type>~ to binary ~operator<~
badcode.cpp:41: error: overloaded function with no contextual type information
badcode.cpp:42: error: invalid operands of types ~double~ and ~<unknown type>~ to binary ~operator>~
badcode.cpp:42: error: overloaded function with no contextual type information
badcode.cpp:47: error: no match for ~operator<<~ in ~std::operator<< [with _Traits = std::char_traits<char>](((std::basic_ostream<char, std::char_traits<char> >&)(& std::cout)), ((const char*)"The minimum value of the function is : ")) << std::min~
If you're not getting all those, I don't know what you're using as a compiler.