File: vcl_cmath.cxx

package info (click to toggle)
insighttoolkit 3.20.1%2Bgit20120521-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 80,652 kB
  • sloc: cpp: 458,133; ansic: 196,223; fortran: 28,000; python: 3,839; tcl: 1,811; sh: 1,184; java: 583; makefile: 430; csh: 220; perl: 193; xml: 20
file content (41 lines) | stat: -rw-r--r-- 1,307 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// This is vcl/vcl_cmath.cxx

//:
// \file
// \author fsm

#include "vcl_cmath.h"

#ifdef __GNUC__
double tickle_cmath_inlines()
{
  float f = vcl_abs(1.0f);
  double d = vcl_abs(1.0);
  return f + d;
}
#endif


#if defined(__SUNPRO_CC) && (__SUNPRO_CC == 0x500)
// these symbols go missing at link time. I suspect
// they are not provided in the run-time library.
// fsm
namespace std {
  float atan2(float y, float x) { return float(std::atan2(double(y), double(x))); }
  float sqrt(float x) { return float(std::sqrt(double(x))); }
  float ceil(float x) { return float(std::ceil(double(x))); }
  float floor(float x) { return float(std::floor(double(x))); }
  float sin(float x) { return float(std::sin(double(x))); }
  float fabs(float x) { return float(std::fabs(double(x))); }
  float cos(float x) { return float(std::cos(double(x))); }
  float pow(float x, float a) { return float(std::pow(double(x), double(a))); }
  float exp(float x) { return float(std::exp(double(x))); }
  float log(float x) { return float(std::log(double(x))); }
  float acos(float x) { return float(std::acos(double(x))); }

  double abs(double x) { return x >= 0 ? x : -x; }

  long double sqrt(long double x) { return std::sqrt(double(x)); } // ouch!
  double pow(double x, int n) { return std::pow(x, double(n)); }
}
#endif