Author Topic: cmath and math.h in Linux  (Read 10900 times)

Offline slanker70

  • Single posting newcomer
  • *
  • Posts: 6
cmath and math.h in Linux
« on: June 01, 2009, 11:29:51 pm »
Hi,

I'm having problem regarding these 2 math functions:

1. acos
2. sqrt

If I include math.h it coudn't find sqrt, and if I include cmath it says that acos is undefined.

So I view the cmath header file and inside it includes math.h, but when I try to open math.h it says that file is not found. SO ithink my math.h is missing in Linux.

Can someone please help.

Regards,

Dana

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: cmath and math.h in Linux
« Reply #1 on: June 02, 2009, 06:49:37 am »
#include <cmath>

and then :  std::acos ,  std::sqrt

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: cmath and math.h in Linux
« Reply #2 on: June 02, 2009, 07:20:49 am »
Can someone please help.
Luckily you received help even if you violate our forum rules. This is NOT a general programming forum. Topic locked.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ