RE:Re: problem with CINT `**' extension

Pasha Murat (murat@cdfsga.fnal.gov)
Tue, 8 Dec 1998 23:52:34 -0600 (CST)


Hi Masa, here is what Python answered me when I asked it to do the same:

root [13] /cdf/upgrade/tracking/murat/g3/test>python
Python 1.4 (Jul 29 1997) [GCC 2.7.2.1]
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> 9999999999+9999999999
OverflowError: integer literal too large

Sounds reasonable. -regards, pasha.

Masaharu Goto writes:
> Pasha,
>
> The power operator '**' and '@' are the original extention of CINT. These
> operators are defined both for int and double. There is no error error check
> in int version. Sinse, cint is there for some time, change has to be done
> carefully. If everybody agrees printing an error message in such case, I'll
> do so. Or if everybody agrees eliminating power operator for 'int' , it is
> even easier.
>
> Masaharu Goto
>
> --------------------------------------------------------------------
> Dear Urs, you're definitely right, but this doesn't make the life safer
> - a simple misprint could lead to the results being completely
> screwed up. I think there should be kind of check of argument validity range,
> otherwise one gets:
>
> root [28] 9999999999+9999999999
> (int)(-2)
>
> -regards, pasha.
> Urs Langenegger writes:
> >
> > I think that has less to do with '**' but with (int). If I cast onto
> > (double), everything works fine for me.
> >
> > Cheers,
> > --U.