Where is C99 round function?
-
Monday, February 20, 2006 6:18 PMFirst, I post this question to Visual C++ Language but it seems it's OT there, so I repost it here as it relates to VC++ 8.0 libraries
Hi,
It may seem to be extremely trivial quesion, but I completely have no idea why I can not find round function in math.h?
I use VC++ 8.0 so I suppose it brings very up to date C/C++ librareries.
round function was added in C99:
http://www.dinkumware.com/manuals/reader.aspx?b=c/&h=math.html#round
http://www.gnu.org/software/libc/manual/html_mono/libc.html#Rounding%20Functions
I've greped through CRT sources shipped with VC++ 8.0 and there is no such function.
Where can I find it?
Cheers
All Replies
-
Monday, February 20, 2006 9:17 PMModerator
VC2005 doesn't even have support for C projects that I have seen, nor does it let you add a .c file, you have to do it manually. I'd be surprised if they supported C99.
-
Monday, February 20, 2006 10:28 PMModerator
VC8.0 doesn't fully support the C99 standards as Christian indicated.
Thanks, Ayman Shoukry VC++ Team -
Tuesday, February 21, 2006 6:23 AMI'm in shock!
What people pay 800$ for?
I read about "standards conformance" of VC++ 8.0 everwhere so I ask where is that conformance?
Guys, you're working hard to include new and very experimental stuff like C++/CLI but you are not interested in making VC++ conformant to C99, rather old standard?
Please, tell me how widely C++/CLI is used in comparison to C99 features?
C++/CLI even won't be discussed in the nearest ACCU Conference 2006 !
I will never understand Microsoft's way and there is no hope!
Cheers -
Tuesday, February 21, 2006 3:10 PMModerator
We are trying to be more conformant to the C++ Standard. We have done some breaking changes for that as well. Nevertheless, I understand your comment. Please go ahead and log it at http://lab.msdn.microsoft.com/productfeedback/default.aspx. This gives us a great way of understanding what the community wants.
BTW, _controlfp could be used in some cases: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt__control87.2c_._controlfp.asp
Thanks, Ayman Shoukry VC++ Team -
Tuesday, February 21, 2006 9:56 PMModerator
It's a C++ compiler. Microsoft is doing amazing things for C++ standards comformance. The compiler doesn't even offer C projects, nor does it allow you to add a .c file in the IDE, I'd say you're playing with mostly legacy support. I would imagine the market for a C compiler is about 1-4% of the market for a C++ compiler.
People pay $800 for a very good C++ compiler, and that is the standards conformance you've been reading about.
>>Please, tell me how widely C++/CLI is used in comparison to C99 features?
In my world, VB is totally unused, I don't know anyone local to me who uses it. It sounds like you don't know anyone who uses C++/CLI ( I barely use it myself ). I know no-one who uses C, let alone C99. In other words, what you percieve as 'widely used' is a result of the circles you move in.
-
Wednesday, February 22, 2006 12:05 PM
Ayman Shoukry wrote: We are trying to be more conformant to the C++ Standard. We have done some breaking changes for that as well. Yes, I know that.
Ayman Shoukry wrote: Nevertheless, I understand your comment. Please go ahead and log it at http://lab.msdn.microsoft.com/productfeedback/default.aspx. This gives us a great way of understanding what the community wants. I'm glad you understand my point. I'll give my feedback too.
Ayman Shoukry wrote: BTW, _controlfp could be used in some cases Thanks, I'll try it.
Is this true VC++ 8.0 should not be used as a C compiler? I don't understand it. Please, tell me what would you say Charles Petzold's Windows API books readers? AFAIK Petzold's examples are poor C programs. Should they use MinGW?
Simply, I don't get cgraus' point about that VC++ 8.0 is only C++ compilers.
p.s. Certainly, that's clear C++ libraries and programs are based/compatible on C libraries.
Cheers
-
Wednesday, February 22, 2006 1:52 PM
cgraus wrote: It's a C++ compiler. So, now I can try to understand it. As I read in Appendinx C to Standard for Programming Language C++ (working draft):
7 The C++ Standard library provides 209 standard functions from the C library, as shown in Table 102.
And there is no round function in this Table 102. So, now your point seems to be clear.
cgraus wrote: Microsoft is doing amazing things for C++ standards comformance. Yes, I know that.
cgraus wrote: The compiler doesn't even offer C projects, nor does it allow you to add a .c file in the IDE, You're right, but some time ago it did. How Charles Petzold created his sample projects?
cgraus wrote: People pay $800 for a very good C++ compiler, and that is the standards conformance you've been reading about. From this point of view I agree.
Cheers
-
Wednesday, February 22, 2006 7:38 PMModerator
>> Is this true VC++ 8.0 should not be used as a C compiler? I don't understand it.
Surely the fact that the IDE doesn't actually support you creating .c files, you need to do it by hand, is a sign of how much C was in the mind of the VC++2005 team ?
But, it IS a C compiler. Just not C99.
>> . Please, tell me what would you say Charles Petzold's Windows API books readers?
LOL - I'd say 'welcome to hell'. I can't imagine anyone buying VC2005 so they can write Petzold style WndProc programs.
>> Simply, I don't get cgraus' point about that VC++ 8.0 is only C++ compilers.
That's just not my point. My point is that VC++ is SOLD as a C++ compiler, and I suspect the c compiler support is legacy stuff. My CORE point is that no-one has ever claimed it would support C99.
>> p.s. Certainly, that's clear C++ libraries and programs are based/compatible on C libraries.
MOST C code will compile in c++. C99 widens that gap.
-
Thursday, February 23, 2006 10:02 AM
cgraus wrote: >> Is this true VC++ 8.0 should not be used as a C compiler? I don't understand it.
Surely the fact that the IDE doesn't actually support you creating .c files, you need to do it by hand, is a sign of how much C was in the mind of the VC++2005 team ?
But, it IS a C compiler. Just not C99.
OK, I have been clarified with this subject now. Thanks.
cgraus wrote: >> . Please, tell me what would you say Charles Petzold's Windows API books readers?
LOL - I'd say 'welcome to hell'. I can't imagine anyone buying VC2005 so they can write Petzold style WndProc programs.
Yes, I can imagine it :-)
cgraus wrote: >> Simply, I don't get cgraus' point about that VC++ 8.0 is only C++ compilers.
That's just not my point. My point is that VC++ is SOLD as a C++ compiler, and I suspect the c compiler support is legacy stuff. My CORE point is that no-one has ever claimed it would support C99.
I understand it.
Cheers
-
Thursday, March 27, 2008 1:23 PM
Hello guys, I had the same problem, because I'm starting to use visual C++, but I have a lot of past C code that I want to use in my future C++ projects...it's not a big problem anyway.
But I have another question, I've downloaded libc2.5.1 from the web, is it possible to include all of it in my C++ projects?
and if so, how can I do it?
thanks
Francesco

