// ----------------------------------------------------------------------
//
// cmathver.cc - Do we have all variants of cmath functions?
//
// History:
//   23-Jun-1999  WEB  Initial draft
//   07-Sep-1999  WEB  Use USING instead of USING_NAMESPACE directive
//   15-Feb-2000  WEB  Update to correspond to revised USING macro
//   25-Apr-2001  WEB  s/<ISOcxxSyntax.hh>/"ISOcxx\/ISOcxxSyntax.hh"/
//
// ----------------------------------------------------------------------


#include "ISOcxx/ISOcxxSyntax.hh"

#include <cmath>


int  main()  {

  USING( std::sqrt )

  int  result( 0 );

  if ( sizeof(double) != sizeof(sqrt(2.5 )) )
    result += 1;

#if 1
  if ( sizeof(float) != sizeof(sqrt(2.5F)) )
    result += 2;
#else
  if (  sizeof(float) != sizeof(double) )  {
    double  NearF( 2.0F - sqrt(2.0F) * sqrt(2.0F) );
    double  NearD( 2.0  - sqrt(2.0 ) * sqrt(2.0 ) );
    if ( NearF*NearF <= NearD*NearD )
      result += 2;
  }
#endif

#if 1
  if ( sizeof(long double) != sizeof(sqrt(2.5L)) )
    result += 4;
#else
  if (  sizeof(long double) != sizeof(double) )  {
    long double  NearD( 2.0  - sqrt(2.0 ) * sqrt(2.0 ) );
    long double  NearL( 2.0L - sqrt(2.0L) * sqrt(2.0L) );
    if ( NearD*NearD <= NearL*NearL )
      result += 4;
  }
#endif

  return  result;

}  // main()
