LEFT | RIGHT |
(no file at all) | |
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 12 matching lines...) Expand all Loading... |
23 #define INT64X64_128_H | 23 #define INT64X64_128_H |
24 | 24 |
25 #include <stdint.h> | 25 #include <stdint.h> |
26 #include <cmath> // pow | 26 #include <cmath> // pow |
27 | 27 |
28 #if defined(HAVE___UINT128_T) && !defined(HAVE_UINT128_T) | 28 #if defined(HAVE___UINT128_T) && !defined(HAVE_UINT128_T) |
29 typedef __uint128_t uint128_t; | 29 typedef __uint128_t uint128_t; |
30 typedef __int128_t int128_t; | 30 typedef __int128_t int128_t; |
31 #endif | 31 #endif |
32 | 32 |
| 33 #include "ns3/ns3-module.h" |
| 34 #define NS3_MODULE NS3_CORE_MODULE |
| 35 #include "ns3/ns3-export.h" |
| 36 |
33 /** | 37 /** |
34 * \file | 38 * \file |
35 * \ingroup highprec | 39 * \ingroup highprec |
36 * Declaration of the ns3::int64x64_t type using a native int128_t type.. | 40 * Declaration of the ns3::int64x64_t type using a native int128_t type.. |
37 */ | 41 */ |
38 | 42 |
39 namespace ns3 { | 43 namespace ns3 { |
40 | 44 |
41 /** | 45 /** |
42 * \internal | 46 * \internal |
43 * The implementation documented here is based on native 128-bit integers. | 47 * The implementation documented here is based on native 128-bit integers. |
44 */ | 48 */ |
45 class int64x64_t | 49 class NS3_EXPORT int64x64_t |
46 { | 50 { |
47 /// uint128_t high bit (sign bit). | 51 /// uint128_t high bit (sign bit). |
48 static const uint128_t HP128_MASK_HI_BIT = (((int128_t)1)<<127); | 52 static const uint128_t HP128_MASK_HI_BIT = (((int128_t)1)<<127); |
49 /// Mask for fraction part. | 53 /// Mask for fraction part. |
50 static const uint64_t HP_MASK_LO = 0xffffffffffffffffULL; | 54 static const uint64_t HP_MASK_LO = 0xffffffffffffffffULL; |
51 /// Mask for sign + integer part. | 55 /// Mask for sign + integer part. |
52 static const uint64_t HP_MASK_HI = ~HP_MASK_LO; | 56 static const uint64_t HP_MASK_HI = ~HP_MASK_LO; |
53 /** | 57 /** |
54 * Floating point value of HP_MASK_LO + 1. | 58 * Floating point value of HP_MASK_LO + 1. |
55 * We really want: | 59 * We really want: |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 */ | 429 */ |
426 inline int64x64_t operator ! (const int64x64_t & lhs) | 430 inline int64x64_t operator ! (const int64x64_t & lhs) |
427 { | 431 { |
428 return int64x64_t (!lhs._v); | 432 return int64x64_t (!lhs._v); |
429 } | 433 } |
430 | 434 |
431 | 435 |
432 } // namespace ns3 | 436 } // namespace ns3 |
433 | 437 |
434 #endif /* INT64X64_128_H */ | 438 #endif /* INT64X64_128_H */ |
LEFT | RIGHT |