LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2010 INRIA· | 3 * Copyright (c) 2010 INRIA· |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 190 |
191 /** | 191 /** |
192 * Get this value as a double. | 192 * Get this value as a double. |
193 * | 193 * |
194 * \return This value in floating form. | 194 * \return This value in floating form. |
195 */ | 195 */ |
196 inline double GetDouble (void) const | 196 inline double GetDouble (void) const |
197 { | 197 { |
198 const bool negative = _cairo_int128_negative (_v); | 198 const bool negative = _cairo_int128_negative (_v); |
199 const cairo_int128_t value = negative ? _cairo_int128_negate (_v) : _v; | 199 const cairo_int128_t value = negative ? _cairo_int128_negate (_v) : _v; |
200 const long double fhi = static_cast<long double>(value.hi); | 200 const long double fhi = static_cast<long double> (value.hi); |
201 const long double flo = value.lo / HP_MAX_64; | 201 const long double flo = value.lo / HP_MAX_64; |
202 long double retval = fhi; | 202 long double retval = fhi; |
203 retval += flo; | 203 retval += flo; |
204 retval = negative ? -retval : retval; | 204 retval = negative ? -retval : retval; |
205 return static_cast<double>(retval); | 205 return static_cast<double> (retval); |
206 } | 206 } |
207 /** | 207 /** |
208 * Get the integer portion. | 208 * Get the integer portion. |
209 * | 209 * |
210 * \return The integer portion of this value. | 210 * \return The integer portion of this value. |
211 */ | 211 */ |
212 inline int64_t GetHigh (void) const | 212 inline int64_t GetHigh (void) const |
213 { | 213 { |
214 return (int64_t)_v.hi; | 214 return (int64_t)_v.hi; |
215 } | 215 } |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 */ | 409 */ |
410 inline int64x64_t operator ! (const int64x64_t & lhs) | 410 inline int64x64_t operator ! (const int64x64_t & lhs) |
411 { | 411 { |
412 return (lhs == int64x64_t ()) ? int64x64_t (1, 0) : int64x64_t (); | 412 return (lhs == int64x64_t ()) ? int64x64_t (1, 0) : int64x64_t (); |
413 } | 413 } |
414 | 414 |
415 | 415 |
416 } // namespace ns3 | 416 } // namespace ns3 |
417 | 417 |
418 #endif /* INT64X64_CAIRO_H */ | 418 #endif /* INT64X64_CAIRO_H */ |
LEFT | RIGHT |