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

Benjamin Kosnik bkoz@redhat.com
Mon Apr 2 15:13:00 GMT 2001


"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



More information about the Libstdc++ mailing list