1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %% Purpose: wxLongLong documentation
4 %% Author: Vadim Zeitlin
8 %% Copyright: (c) Vadim Zeitlin
9 %% License: wxWindows license
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12 \section{\class{wxLongLong
}}\label{wxlonglong
}
14 This class represents a signed
64 bit long number. It is implemented using the
15 native
64 bit type where available (machines with
64 bit longs or compilers
16 which have (an analog of)
{\it long long
} type) and uses the emulation code in
17 the other cases which ensures that it is the most efficient solution for
18 working with
64 bit integers independently of the architecture.
20 wxLongLong defines all usual arithmetic operations such as addition,
21 substraction, bitwise shifts and logical operations as well as multiplication
22 and division (not yet for the machines without native
{\it long long
}). It
23 also has operators for implicit construction from and conversion to the native
24 {\it long long
} type if it exists and
{\it long
}.
26 You would usually use this type in exactly the same manner as any other
27 (built-in) arithmetic type. Note that wxLongLong is a signed type.
29 If a native (i.e. supported directly by the compiler)
64 bit integer type was
30 found a typedef
{\it wxLongLong
\_t} will be defined to correspond it.
32 \wxheading{Derived from
}
36 \wxheading{Include files
}
40 \latexignore{\rtfignore{\wxheading{Members
}}}
42 \membersection{wxLongLong::wxLongLong
}\label{wxlonglongwxlonglongdef
}
44 \func{}{wxLongLong
}{\void}
46 Default constructor initializes the object to
0.
48 \membersection{wxLongLong::wxLongLong
}\label{wxlonglongwxlonglongll
}
50 \func{}{wxLongLong
}{\param{wxLongLong
\_t }{ll
}}
52 Constructor from native long long (only for compilers supporting it).
54 \membersection{wxLongLong::wxLongLong
}\label{wxlonglongwxlonglong
}
56 \func{}{wxLongLong
}{\param{long
}{hi
},
\param{unsigned long
}{lo
}}
58 Constructor from
2 longs: the high and low part are combined into one
61 \membersection{wxLongLong::operator=
}\label{wxlonglongoperatorassign
}
63 \func{wxLongLong\& operator
}{operator=
}{\param{wxLongLong
\_t }{ll
}}
65 Assignment operator from native long long (only for compilers supporting it).
67 \membersection{wxLongLong::Abs
}\label{wxlonglongabs
}
69 \constfunc{wxLongLong
}{Abs
}{\void}
71 \func{wxLongLong\&
}{Abs
}{\void}
73 Returns an absolute value of wxLongLong - either making a copy (const version)
74 or modifying it in place (the second one).
76 \membersection{wxLongLong::Assign
}\label{wxlonglongassign
}
78 \func{wxLongLong\&
}{Assign
}{\param{double
}{d
}}
80 This allows to convert a double value to wxLongLong type. Such conversion is
81 not always possible in which case the result will be silently truncated in a
82 platform-dependent way.
84 \membersection{wxLongLong::GetHi
}\label{wxlonglonggethi
}
86 \constfunc{long
}{GetHi
}{\void}
88 Returnes the high
32 bits of
64 bit integer.
90 \membersection{wxLongLong::GetLo
}\label{wxlonglonggetlo
}
92 \constfunc{unsigned long
}{GetLo
}{\void}
94 Returnes the low
32 bits of
64 bit integer.
96 \membersection{wxLongLong::GetValue
}\label{wxlonglonggetvalue
}
98 \constfunc{wxLongLong
\_t}{GetValue
}{\void}
100 Convert to native long long (only for compilers supporting it)
102 \membersection{wxLongLong::ToLong
}\label{wxlonglongtolong
}
104 \constfunc{long
}{ToLong
}{\void}
106 Truncate wxLongLong to long. If the conversion loses data (i.e. the wxLongLong
107 value is outside the range of built-in long type), an assert will be triggered
110 \membersection{wxLongLong::operator$+$
}\label{wxlonglongoperatorplus
}
112 \constfunc{wxLongLong
}{operator$+$
}{\param{const wxLongLong\&
}{ll
}}
114 Adds
2 wxLongLongs together and returns the result.
116 \membersection{wxLongLong::operator$+=$
}\label{wxlonglongoperatorplusassign
}
118 \func{wxLongLong\&
}{operator+
}{\param{const wxLongLong\&
}{ll
}}
120 Add another wxLongLong to this one.
122 \membersection{wxLongLong::operator$++$
}\label{wxlonglongoperatorinc
}
124 \func{wxLongLong\&
}{operator$++$
}{\void}
126 \func{wxLongLong\&
}{operator$++$
}{\param{int
}{}}
128 Pre/post increment operator.
130 \membersection{wxLongLong::operator$-$
}\label{wxlonglongoperatorunaryminus
}
132 \constfunc{wxLongLong
}{operator$-$
}{\void}
134 Returns the value of this wxLongLong with opposite sign.
136 \membersection{wxLongLong::operator$-$
}\label{wxlonglongoperatorminus
}
138 \constfunc{wxLongLong
}{operator$-$
}{\param{const wxLongLong\&
}{ll
}}
140 Substracts
2 wxLongLongs and returns the result.
142 \membersection{wxLongLong::operator$-=$
}\label{wxlonglongoperatorminusassign
}
144 \func{wxLongLong\&
}{operator-
}{\param{const wxLongLong\&
}{ll
}}
146 Substracts another wxLongLong from this one.
148 \membersection{wxLongLong::operator$--$
}\label{wxlonglongoperatordec
}
150 \func{wxLongLong\&
}{operator$--$
}{\void}
152 \func{wxLongLong\&
}{operator$--$
}{\param{int
}{}}
154 Pre/post decrement operator.
156 % TODO document all other arithmetics operations: shifts, multiplication,
157 % division, bitwise, comparison