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 subtraction, 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, if you
28 want unsigned values use wxULongLong which has exactly the same API as
29 wxLongLong except when explicitly mentioned otherwise.
31 If a native (i.e. supported directly by the compiler)
64 bit integer type was
32 found to exist,
{\it wxLongLong
\_t} macro will be defined to correspond to it.
33 Also, in this case only, two additional macros will be defined:
34 \helpref{wxLongLongFmtSpec
}{wxlonglongfmtspec
} for printing
64 bit integers
35 using the standard
{\tt printf()
} function (but see also
36 \helpref{ToString()
}{wxlonglongtostring
} for a more portable solution) and
37 \helpref{wxLL
}{wxll
} for defining
64 bit integer compile-time constants.
39 \wxheading{Derived from
}
43 \wxheading{Include files
}
49 \helpref{wxBase
}{librarieslist
}
51 \latexignore{\rtfignore{\wxheading{Members
}}}
54 \membersection{wxLongLong::wxLongLong
}\label{wxlonglongwxlonglongdef
}
56 \func{}{wxLongLong
}{\void}
58 Default constructor initializes the object to
0.
61 \membersection{wxLongLong::wxLongLong
}\label{wxlonglongwxlonglongll
}
63 \func{}{wxLongLong
}{\param{wxLongLong
\_t }{ll
}}
65 Constructor from native long long (only for compilers supporting it).
68 \membersection{wxLongLong::wxLongLong
}\label{wxlonglongwxlonglong
}
70 \func{}{wxLongLong
}{\param{long
}{hi
},
\param{unsigned long
}{lo
}}
72 Constructor from
2 longs: the high and low part are combined into one
76 \membersection{wxLongLong::operator=
}\label{wxlonglongoperatorassign
}
78 \func{wxLongLong\& operator
}{operator=
}{\param{wxLongLong
\_t }{ll
}}
80 Assignment operator from native long long (only for compilers supporting it).
83 \membersection{wxLongLong::operator=
}\label{wxlonglongoperatorassignull
}
85 \func{wxLongLong\& operator
}{operator=
}{\param{wxULongLong
\_t }{ll
}}
87 Assignment operator from native unsigned long long (only for compilers
92 \membersection{wxLongLong::operator=
}\label{wxlonglongoperatorassignlong
}
94 \func{wxLongLong\& operator
}{operator=
}{\param{long
}{l
}}
96 Assignment operator from long.
100 \membersection{wxLongLong::operator=
}\label{wxlonglongoperatorassignulong
}
102 \func{wxLongLong\& operator
}{operator=
}{\param{unsigned long
}{l
}}
104 Assignment operator from unsigned long.
108 \membersection{wxLongLong::operator=
}\label{wxlonglongoperatorassignulonglong
}
110 \func{wxLongLong\& operator
}{operator=
}{\param{const wxULongLong \&
}{ll
}}
112 Assignment operator from unsigned long long. The sign bit will be copied too.
116 \membersection{wxLongLong::Abs
}\label{wxlonglongabs
}
118 \constfunc{wxLongLong
}{Abs
}{\void}
120 \func{wxLongLong\&
}{Abs
}{\void}
122 Returns an absolute value of wxLongLong - either making a copy (const version)
123 or modifying it in place (the second one). Not in wxULongLong.
126 \membersection{wxLongLong::Assign
}\label{wxlonglongassign
}
128 \func{wxLongLong\&
}{Assign
}{\param{double
}{d
}}
130 This allows to convert a double value to wxLongLong type. Such conversion is
131 not always possible in which case the result will be silently truncated in a
132 platform-dependent way. Not in wxULongLong.
135 \membersection{wxLongLong::GetHi
}\label{wxlonglonggethi
}
137 \constfunc{long
}{GetHi
}{\void}
139 Returns the high
32 bits of
64 bit integer.
142 \membersection{wxLongLong::GetLo
}\label{wxlonglonggetlo
}
144 \constfunc{unsigned long
}{GetLo
}{\void}
146 Returns the low
32 bits of
64 bit integer.
149 \membersection{wxLongLong::GetValue
}\label{wxlonglonggetvalue
}
151 \constfunc{wxLongLong
\_t}{GetValue
}{\void}
153 Convert to native long long (only for compilers supporting it)
156 \membersection{wxLongLong::ToDouble
}\label{wxlonglonggetdouble
}
158 \constfunc{double
}{ToDouble
}{\void}
160 Returns the value as
\texttt{double
}.
163 \membersection{wxLongLong::ToLong
}\label{wxlonglongtolong
}
165 \constfunc{long
}{ToLong
}{\void}
167 Truncate wxLongLong to long. If the conversion loses data (i.e. the wxLongLong
168 value is outside the range of built-in long type), an assert will be triggered
172 \membersection{wxLongLong::ToString
}\label{wxlonglongtostring
}
174 \constfunc{wxString
}{ToString
}{\void}
176 Returns the string representation of a wxLongLong.
179 \membersection{wxLongLong::operator$+$
}\label{wxlonglongoperatorplus
}
181 \constfunc{wxLongLong
}{operator$+$
}{\param{const wxLongLong\&
}{ll
}}
183 Adds
2 wxLongLongs together and returns the result.
186 \membersection{wxLongLong::operator$+=$
}\label{wxlonglongoperatorplusassign
}
188 \func{wxLongLong\&
}{operator+
}{\param{const wxLongLong\&
}{ll
}}
190 Add another wxLongLong to this one.
193 \membersection{wxLongLong::operator$++$
}\label{wxlonglongoperatorinc
}
195 \func{wxLongLong\&
}{operator$++$
}{\void}
197 \func{wxLongLong\&
}{operator$++$
}{\param{int
}{}}
199 Pre/post increment operator.
202 \membersection{wxLongLong::operator$-$
}\label{wxlonglongoperatorunaryminus
}
204 \constfunc{wxLongLong
}{operator$-$
}{\void}
206 Returns the value of this wxLongLong with opposite sign. Not in wxULongLong.
209 \membersection{wxLongLong::operator$-$
}\label{wxlonglongoperatorminus
}
211 \constfunc{wxLongLong
}{operator$-$
}{\param{const wxLongLong\&
}{ll
}}
213 Subtracts
2 wxLongLongs and returns the result.
216 \membersection{wxLongLong::operator$-=$
}\label{wxlonglongoperatorminusassign
}
218 \func{wxLongLong\&
}{operator-
}{\param{const wxLongLong\&
}{ll
}}
220 Subtracts another wxLongLong from this one.
223 \membersection{wxLongLong::operator$--$
}\label{wxlonglongoperatordec
}
225 \func{wxLongLong\&
}{operator$--$
}{\void}
227 \func{wxLongLong\&
}{operator$--$
}{\param{int
}{}}
229 Pre/post decrement operator.
231 % TODO document all other arithmetics operations: shifts, multiplication,
232 % division, bitwise, comparison