Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Trouble with #include <cmath>
Trouble with #include <cmath> [message #1737555] Sat, 09 July 2016 20:12
Tom Tr is currently offline Tom TrFriend
Messages: 1
Registered: July 2016
Junior Member
Hey everyone I am having trouble getting cmath to work in eclipse neon on my mac

I am getting the function pow is not found.... How do I fix that?

#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

int main() {

	int input;

	cout << "1.	Calculate the Area of a Circle" << endl;
	cout << "2.	Calculate the Area of a Rectangle" << endl;
	cout << "3.	Calculate the Area of a Triangle" << endl;
	cout << "4.	Calculate the Area of a Trapezoid" << endl;
	cout << "5.	Calculate the Area of a Sphere" << endl;
	cout << "6.	Exit" << endl;
	cout << "Enter your Choice (1-6): " << endl;
	cin >> input;

	switch (input){

	case 1:
		const int pi = 3.14159;
		int circleRadius;
		int circleArea = pi * pow(circleRadius,2);

		cout << "Enter the radius of your Circle?" << endl;
		cin >> circleRadius;

		cout << "The Area of your Circle is: " << circleArea << endl;

		break;

Previous Topic:Importing cmake projet
Next Topic:In Makefile projects, how do you "clean" project without "building/rebuilding" t
Goto Forum:
  


Current Time: Mon Sep 23 16:06:26 GMT 2024

Powered by FUDForum. Page generated in 0.02787 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top