View Full Version : C Library Problem
Peter P.
Oct7-11, 07:43 PM
I was working on an assignment and i needed to use a constant that is defined in the math.h library (M_E). But when i tried to use it, the compiler took it as a normal variable that had not been initialized or anything. So my question is, is this just because of the compiler i was using, or is there something wrong with the library on my laptop?
According to this wiki article (http://en.wikipedia.org/wiki/Math.h), the M_* constants aren't standard. It also says,
While these constants are common, they are not part of the C standard, so most modern compilers require an explicit definition (such as _USE_MATH_DEFINES in Microsoft Visual C++ [1]) for them to be defined when including math.h.
Peter P.
Oct8-11, 12:55 AM
Thanks for the answer, that cleared it up for me.
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.