C History

  • 1978 K&R C
  • 1989 C89 (ANSI C) ANSI X3.159-1989, standardized
  • 1990 C90 (ISO C) ISO/IEC 9899:1990, same as C89
    • 1995 C95 ISO/IEC 9899/AMD1:1995, to correct some details and to add more extensive support for international character sets
  • 1999 C99 ISO/IEC 9899:1999, for the most part backward compatible with C90, but is stricter in some ways
  • 2011 C11 ISO/IEC 9899:2011, adds numerous new features to C and the library, makes some portions of the existing C99 library optional, and improves compatibility with C++

C++ History

  • 1979 C with classes
    • 1983 C++: Cfront
    • 1985 The C++ Programming Language
  • 1989 C++ 2.0, included multiple inheritance, abstract classes, static member functions, const member functions, and protected members
    • 1990 C++ Reference Manual
    • 1991 second edition of The C++ Programming Language
  • 1998 C++98 ISO/IEC 14882:1998, C++ standards committee standardized C++ and published the international standard
    • 2003 C++03 ISO/IEC 14882:2003, fixed problems identified in C++98
  • 2011 C++11 ISO/IEC 14882:2011, adding numerous new features, enlarging the standard library further, and providing more facilities to C++ programmers
    • 2014 C++14 ISO/IEC 14882:2014, featuring mainly bug fixes and small improvements
  • 2017 C++17 ISO/IEC 14882:2017, a major revision
  • 2020? C++20 future

GCC History

math.h VS cmath

[cmath] defines symbols in the std namespace, and may also define symbols in the global namespace. [math.h] defines symbols in the global namespace, and may also define symbols in the std namespace. if you include the former and use an unqualified symbol, it may compile with one compiler but not with another. therefore it’s a good idea to use [math.h]. and in general, for such header pairs, to use the [.h] version.

c++98 provided a formal guarantee of the cxxx header not polluting the global namespace. maybe that was why they were defined. however, that was a bit harder to implement than polluting ones, so in practice no standard library implementation that i know of followed the standard in this respect, and so it was finally changed to reflect reality in c++11.

isnan and std::isnan

std::isnan is defined in C++98 in cmath and still valid
isnan is defined in C99 in math.h and then inherited by C++11 and so on

math.h and cmath in ROOT and Geant4

ROOT includes both in TMath.h, but cmath is more popular
Geant4 only uses cmath

math.h VS cmath and C/C++ versions
Tagged on:

Leave a Reply

Your email address will not be published. Required fields are marked *