Hi Christian,
seems to be some problem with the handling of operator<<(i+j).
The following lines work ok:
unsigned int k = i + j;
cout << "i = " << i << ",j = " << j << ", i+j = " << k << endl;
printf("i = %u, j = %u, i+j = %u\n", i, j, i+j);
I think Masaharu (the author of CINT) will get back to you soon.
Cheers, Fons.
Christian Guenther wrote:
>
> Hello,
> I'm just evaluating cint for my own personal use and I found some really
> strange behaviour, as the following trivial program demonstrates.
>
> Do you have any ideas ?
>
> Thank you in advance!!
>
> ===================================================================
>
> -> cat /tmp/t1.cc
> #include <iostream.h>
>
> main() {
>
> unsigned int i = 2087856000;
> unsigned int j = 126230400;
>
> cout << "i = " << i << ",j = " << j << ", i+j = " << i+j << endl;
>
> }
>
> -> g++ -Wall -pedantic /tmp/t1.cc -o /tmp/t1
> -> /tmp/t1
> i = 2087856000,j = 126230400, i+j = 2214086400
>
> -> cint /tmp/t1.cc
> i = 2087856000,j = 126230400, i+j = -2080880896
>
> -> cint -v
>
> cint : C/C++ interpreter
> Copyright(c) : 1991~1996 [hp] Hewlett-Packard-Japan
> Author : Masaharu Goto (gotom@jpn.hp.com)
> Copyright(c) : 1995~1998 Masaharu Goto (MXJ02154@niftyserve.or.jp)
> revision : 5.13.74, Sep 19 1998 by M.Goto
>
> ...
>
> -------------------------------------------------------------------------
> Christian Günther __o E-Mail: cg@uebemc.siemens.de
> SIEMENS AG, OeN TR SW D4 _`\<,_ Phone: +49-89-722-41782
> Hofmannstr. 51, D-81359 Muenchen (_)/ (_) Fax: +49-89-722-36703
> -------------------------------------------------------------------------
--
Org: CERN, European Laboratory for Particle Physics.
Mail: 1211 Geneve 23, Switzerland Phone: +41 22 7679248
E-Mail: Fons.Rademakers@cern.ch Fax: +41 22 7677910
This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:38 MET