A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
int64x64.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2010 INRIA
4
*
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
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
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
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
*/
19
20
#ifndef INT64X64_H
21
#define INT64X64_H
22
23
#include "ns3/core-config.h"
24
25
// Order is important here, as it determines which implementation
26
// will generate doxygen API docs. This order mimics the
27
// selection logic in wscript, so we generate docs from the
28
// implementation actually chosen by the configuration.
29
#if defined (INT64X64_USE_128) && !defined (PYTHON_SCAN)
30
#include "
int64x64-128.h
"
31
#elif defined (INT64X64_USE_CAIRO) && !defined (PYTHON_SCAN)
32
#include "
int64x64-cairo.h
"
33
#elif defined (INT64X64_USE_DOUBLE) || defined (PYTHON_SCAN)
34
#include "
int64x64-double.h
"
35
#endif
36
37
#include <iostream>
38
45
namespace
ns3 {
46
85
inline
86
int64x64_t
operator +
(
const
int64x64_t
& lhs,
const
int64x64_t
& rhs)
87
{
88
int64x64_t
tmp = lhs;
89
tmp += rhs;
90
return
tmp;
91
}
96
inline
97
int64x64_t
operator -
(
const
int64x64_t
& lhs,
const
int64x64_t
& rhs)
98
{
99
int64x64_t
tmp = lhs;
100
tmp -= rhs;
101
return
tmp;
102
}
107
inline
108
int64x64_t
operator *
(
const
int64x64_t
& lhs,
const
int64x64_t
& rhs)
109
{
110
int64x64_t
tmp = lhs;
111
tmp *= rhs;
112
return
tmp;
113
}
118
inline
119
int64x64_t
operator /
(
const
int64x64_t
& lhs,
const
int64x64_t
& rhs)
120
{
121
int64x64_t
tmp = lhs;
122
tmp /= rhs;
123
return
tmp;
124
}
129
inline
bool
operator !=
(
const
int64x64_t
& lhs,
const
int64x64_t
& rhs)
130
{
131
return
!(lhs == rhs);
132
}
137
inline
bool
operator <=
(
const
int64x64_t
& lhs,
const
int64x64_t
& rhs)
138
{
139
return
!(lhs > rhs);
140
}
145
inline
bool
operator >=
(
const
int64x64_t
& lhs,
const
int64x64_t
& rhs)
146
{
147
return
!(lhs < rhs);
148
}
167
std::ostream &
operator <<
(std::ostream &os,
const
int64x64_t
&value);
176
std::istream &
operator >>
(std::istream &is,
int64x64_t
&value);
177
184
inline
int64x64_t
Abs
(
const
int64x64_t
&value)
185
{
186
return
(value < 0) ? -value : value;
187
}
188
197
inline
int64x64_t
Min
(
const
int64x64_t
&a,
const
int64x64_t
&b)
198
{
199
return
(a < b) ? a : b;
200
}
209
inline
int64x64_t
Max
(
const
int64x64_t
&a,
const
int64x64_t
&b)
210
{
211
return
(a > b) ? a : b;
212
}
213
214
}
// namespace ns3
215
216
#endif
/* INT64X64_H */
int64x64_t
High precision numerical type, implementing Q64.64 fixed precision.
ns3::operator>>
std::istream & operator>>(std::istream &is, Angles &a)
initialize a struct Angles from input
Definition:
angles.cc:48
int64x64-cairo.h
int64x64-128.h
ns3::operator>=
bool operator>=(const int64x64_t &lhs, const int64x64_t &rhs)
Greater or equal operator.
Definition:
int64x64.h:145
ns3::operator<=
bool operator<=(const int64x64_t &lhs, const int64x64_t &rhs)
Less or equal operator.
Definition:
int64x64.h:137
ns3::operator*
int64x64_t operator*(const int64x64_t &lhs, const int64x64_t &rhs)
Multiplication operator.
Definition:
int64x64.h:108
ns3::Min
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
Minimum.
Definition:
int64x64.h:197
ns3::Max
int64x64_t Max(const int64x64_t &a, const int64x64_t &b)
Maximum.
Definition:
int64x64.h:209
ns3::operator+
int64x64_t operator+(const int64x64_t &lhs, const int64x64_t &rhs)
Addition operator.
Definition:
int64x64.h:86
ns3::operator/
int64x64_t operator/(const int64x64_t &lhs, const int64x64_t &rhs)
Division operator.
Definition:
int64x64.h:119
ns3::Abs
int64x64_t Abs(const int64x64_t &value)
Absolute value.
Definition:
int64x64.h:184
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition:
angles.cc:42
ns3::operator-
int64x64_t operator-(const int64x64_t &lhs, const int64x64_t &rhs)
Subtraction operator.
Definition:
int64x64.h:97
ns3::operator!=
bool operator!=(const BleAccessAddress &a, const BleAccessAddress &b)
Definition:
ble-access-address.h:164
int64x64-double.h
src
core
model
int64x64.h
Generated on Wed Jul 6 2016 17:11:26 for ns-3 by
1.8.6