This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Where is C++'s math.h's double abs(double)?



"C" == math.h
"C++" == cmath

this works:




#include <iostream>
#include <cmath>

int main()
{
  std::cout << std::abs(-1.23e+3) << std::endl;
  return 0;
}


-benjamin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]