Fabian Wein wrote:
Hi Victor,
>What is not defined? That 'int' is signed? Yes, it *is* defined.
The "int" is one of the four "signed integer types" (3.9.1/2).
thanks for answer!
>>I also found no list which gives the types for different
architectures/ compilers.
Not sure what you're looking for and why. Care to rephrase?
In our project all types are wrapped, so we have
typedef Double double;
You mean, reversed, no doubt:
typedef double Double;
typedef Complex std::complex<double>;
typedef std::complex<doubleComplex;
typedef Int ...
Presuming
typedef ... Int;
, what's there in the "..."?
typedef UInt ...
I doubt that this makes sense
Unless you can explain, I am not going to guess.
but on the other side I don't know
what an "int" is on - let's say
Opteron with gcc
Itanium with icc
ppc with ???
Quoting the Standard: "Plain ints have the natural size suggested
by the architecture of the execution environment". IOW, 'int' is
for signed integer arithmetic and it's the best choice for it, no
matter where your program is running.
You can learn its size in bytes by using 'sizeof'. You can learn
its size in bits by multiplying the size in bytes by CHAR_BITS.
You can learn other properties from 'std::numeric_limits<int>'.
If you need some kind of abstraction layer between your arithmetic
operations in your C++ code and the underlying system providing
the actual implemenation, it might make sense. For examle, CGAL
folks have several numeric engines implemented (including the plain
ol' FP types).
Now I know for sure that "int" is not unsigned - thanks :)
I guess double is fixed to 64 bits?
No, it isn't.
BTW, what is a good online ressource? I normally use cppreference.com
I use
www.google.com.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask