[DGD]Casting to int

Felix A. Croes felix at dworkin.nl
Fri Jun 30 18:05:13 CEST 2000


Kris Van Hees <aedil at alchar.org> wrote:

> On Fri, Jun 30, 2000 at 03:07:33PM +0200, Mikael Lind wrote:
> > Quoting Felix A. Croes from 12:40, June 30, 2000:
> > Java was designed to resemble C a lot, so that programmers would feel
> > instantly at home with it. Hence it doesn't make sense to bring up C
> > and Java as two programming languages where the respective designers
> > independently chose truncation over rounding for float to int
> > conversion.
>
> Given that argument, it is hardly possible to discuss anything about programming
> languages due to most of them being fashioned after one another.  Look at LPC
> and the elements it has from C?  Fact is though that the basic choice to have
> Java do the casting to int the same way as C was made for a reason, and causes
> two quite common languages to work the same way.

Why does C truncate floats when casting them to integers?  Because the
matching PDP-11 machine instruction works that way.  I do not consider
this to be a good reason for languages other than C.  I would like LPC
to evolve away from its C roots.  LPC did not have floats originally,
and when I added them I did so in the way I thought best.

Regards,
Dworkin

List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list