| 1 |
*** qd-2.3.17/include/qd/dd_real.h Tue Dec 29 04:18:53 2009 |
| 2 |
--- qd-2.3.17-for-LLVM/include/qd/dd_real.h Thu Jul 23 15:54:13 2015 |
| 3 |
*************** |
| 4 |
*** 25,30 **** |
| 5 |
--- 25,32 ---- |
| 6 |
* |
| 7 |
* Yozo Hida |
| 8 |
*/ |
| 9 |
+ // operator int(), dd_real copysign(), fmax(), lobg(), scalbn() are added |
| 10 |
+ // for complex class of LLVM Clang++ : 23 Jul.2015 Atsushi Suzuki |
| 11 |
|
| 12 |
#ifndef _QD_DD_REAL_H |
| 13 |
#define _QD_DD_REAL_H |
| 14 |
*************** |
| 15 |
*** 156,161 **** |
| 16 |
--- 158,167 ---- |
| 17 |
std::ostream &os = std::cerr) const; |
| 18 |
|
| 19 |
static dd_real debug_rand(); |
| 20 |
+ |
| 21 |
+ // added for complex class of LLVM Clang++: 23 Jul.2015 Atsushi Suzuki |
| 22 |
+ operator int() { return int(x[0]); } |
| 23 |
+ operator int() const { return int(x[0]); } |
| 24 |
}; |
| 25 |
|
| 26 |
|
| 27 |
*************** |
| 28 |
*** 286,290 **** |
| 29 |
--- 292,313 ---- |
| 30 |
#include <qd/dd_inline.h> |
| 31 |
#endif |
| 32 |
|
| 33 |
+ // added for complex class of LLVM Clang++ : 23 Jul.2015 Atsushi Suzuki |
| 34 |
+ inline dd_real copysign(const dd_real &x, const dd_real &y) { |
| 35 |
+ return (y.x[0] < 0.0) ? ((x.x[0] < 0.0) ? x : (-x)) : ((x.x[0] < 0.0) ? (-x) : x); |
| 36 |
+ } |
| 37 |
+ |
| 38 |
+ inline dd_real fmax(const dd_real &x, const dd_real &y) { |
| 39 |
+ return x.x[0] < y.x[0] ? y : x; |
| 40 |
+ } |
| 41 |
+ |
| 42 |
+ inline dd_real logb(const dd_real &y) { |
| 43 |
+ return dd_real(logb(y.x[0])); |
| 44 |
+ } |
| 45 |
+ |
| 46 |
+ inline dd_real scalbn(const dd_real &x, int n) { |
| 47 |
+ return dd_real(scalb(x.x[0], n)); |
| 48 |
+ } |
| 49 |
+ |
| 50 |
#endif /* _QD_DD_REAL_H */ |
| 51 |
|
| 52 |
*** qd-2.3.17/include/qd/qd_real.h Mon May 11 19:45:05 2009 |
| 53 |
--- qd-2.3.17-for-LLVM/include/qd/qd_real.h Thu Jul 23 15:41:24 2015 |
| 54 |
*************** |
| 55 |
*** 20,25 **** |
| 56 |
--- 20,28 ---- |
| 57 |
* |
| 58 |
* Yozo Hida |
| 59 |
*/ |
| 60 |
+ // operator int(), dd_real copysign(), fmax(), lobg(), scalbn() are added |
| 61 |
+ // for complex class of LLVM Clang++ : 23 Jul.2015 Atsushi Suzuki |
| 62 |
+ |
| 63 |
#ifndef _QD_QD_REAL_H |
| 64 |
#define _QD_QD_REAL_H |
| 65 |
|
| 66 |
*************** |
| 67 |
*** 134,139 **** |
| 68 |
--- 137,146 ---- |
| 69 |
|
| 70 |
static qd_real debug_rand(); |
| 71 |
|
| 72 |
+ // added for complex class of LLVM Clang++: 23 Jul.2015 Atsushi Suzuki |
| 73 |
+ operator int() { return int(x[0]); } |
| 74 |
+ operator int() const { return int(x[0]); } |
| 75 |
+ |
| 76 |
}; |
| 77 |
|
| 78 |
namespace std { |
| 79 |
*************** |
| 80 |
*** 289,293 **** |
| 81 |
--- 296,318 ---- |
| 82 |
#include <qd/qd_inline.h> |
| 83 |
#endif |
| 84 |
|
| 85 |
+ // added for complex class of LLVM Clang++ : 23 Jul.2015 Atsushi Suzuki |
| 86 |
+ |
| 87 |
+ inline qd_real copysign(const qd_real &x, const qd_real &y) { |
| 88 |
+ return (y.x[0] < 0.0) ? ((x.x[0] < 0.0) ? x : (-x)) : ((x.x[0] < 0.0) ? (-x) : x); |
| 89 |
+ } |
| 90 |
+ |
| 91 |
+ inline qd_real fmax(const qd_real &x, const qd_real &y) { |
| 92 |
+ return x.x[0] < y.x[0] ? y : x; |
| 93 |
+ } |
| 94 |
+ |
| 95 |
+ inline qd_real logb(const qd_real &y) { |
| 96 |
+ return qd_real(logb(y.x[0])); |
| 97 |
+ } |
| 98 |
+ |
| 99 |
+ inline qd_real scalbn(const qd_real &x, int n) { |
| 100 |
+ return qd_real(scalb(x.x[0], n)); |
| 101 |
+ } |
| 102 |
+ |
| 103 |
#endif /* _QD_QD_REAL_H */ |
| 104 |
|