OLD | NEW |
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 |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with this program; if not, write to the Free Software | 15 * along with this program; if not, write to the Free Software |
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 * | 17 * |
18 */ | 18 */ |
19 | 19 |
20 #include "ns3/core-config.h" | 20 #include "ns3/core-config.h" |
21 #if !defined(INT64X64_DOUBLE_H) && (defined (INT64X64_USE_DOUBLE) || defined(PYT
HON_SCAN)) | 21 #if !defined(INT64X64_DOUBLE_H) && (defined (INT64X64_USE_DOUBLE) || defined(PYT
HON_SCAN)) |
22 #define INT64X64_DOUBLE_H | 22 #define INT64X64_DOUBLE_H |
23 | 23 |
24 #include <stdint.h> | 24 #include <stdint.h> |
25 #include <cmath> // pow | 25 #include <cmath> // pow |
26 #include <utility> // pair | 26 #include <utility> // pair |
27 | 27 |
| 28 #include "ns3/ns3-module.h" |
| 29 #define NS3_MODULE NS3_CORE_MODULE |
| 30 #include "ns3/ns3-export.h" |
| 31 |
28 /** | 32 /** |
29 * \file | 33 * \file |
30 * \ingroup highprec | 34 * \ingroup highprec |
31 * Declaration and implementation of the ns3::int64x64_t type | 35 * Declaration and implementation of the ns3::int64x64_t type |
32 * using the double type. | 36 * using the double type. |
33 */ | 37 */ |
34 | 38 |
35 namespace ns3 { | 39 namespace ns3 { |
36 | 40 |
37 /** | 41 /** |
38 * \internal | 42 * \internal |
39 * The implementation documented here uses native long double. | 43 * The implementation documented here uses native long double. |
40 */ | 44 */ |
41 class int64x64_t | 45 class NS3_EXPORT int64x64_t |
42 { | 46 { |
43 /// Mask for fraction part | 47 /// Mask for fraction part |
44 static const uint64_t HP_MASK_LO = 0xffffffffffffffffULL; | 48 static const uint64_t HP_MASK_LO = 0xffffffffffffffffULL; |
45 /** | 49 /** |
46 * Floating point value of HP_MASK_LO + 1 | 50 * Floating point value of HP_MASK_LO + 1 |
47 * We really want: | 51 * We really want: |
48 * \code | 52 * \code |
49 * static const long double HP_MAX_64 = std:pow (2.0L, 64); | 53 * static const long double HP_MAX_64 = std:pow (2.0L, 64); |
50 * \endcode | 54 * \endcode |
51 * but we can't call functions in const definitions, | 55 * but we can't call functions in const definitions, |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 */ | 345 */ |
342 inline int64x64_t operator ! (const int64x64_t & lhs) | 346 inline int64x64_t operator ! (const int64x64_t & lhs) |
343 { | 347 { |
344 return int64x64_t (!lhs._v); | 348 return int64x64_t (!lhs._v); |
345 } | 349 } |
346 | 350 |
347 | 351 |
348 } // namespace ns3 | 352 } // namespace ns3 |
349 | 353 |
350 #endif /* INT64X64_DOUBLE_H */ | 354 #endif /* INT64X64_DOUBLE_H */ |
OLD | NEW |