C Library Problem: M_E Constant Issues

  • Thread starter Thread starter Peter P.
  • Start date Start date
AI Thread Summary
The discussion revolves around the use of the M_E constant from the math.h library in C programming. The user encountered an issue where the compiler treated M_E as an uninitialized variable. It was clarified that M_* constants, while commonly used, are not part of the C standard. Most modern compilers require an explicit definition, such as _USE_MATH_DEFINES in Microsoft Visual C++, to recognize these constants when including math.h. This information helped resolve the user's confusion regarding the compiler's behavior.
Peter P.
Messages
23
Reaction score
0
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?
 
Technology news on Phys.org
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.
 
Thanks for the answer, that cleared it up for me.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top