swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Integer arithmetic in Java


From: M Lang / S Railsback
Subject: Re: Integer arithmetic in Java
Date: Wed, 05 Dec 2001 12:49:44 -0700

Tim Howe wrote:
> 
> Steve,
> 
> The behavior you described can be deduced, more or less, from two basic
> principles.
> 
> One principle is that languages can be much simpler if they're context-free.
> One of the ways in which Java is context-free is that expressions are
> evaluated (and values are promoted) without regard to the context in which
> the expressions are found.
> 
> Another principle is that conversion is automatic and silent if no
> information is lost in the conversion.

OK! I was hoping this would just fade away...

My original posting was a mis-representation of the bug we found, which
was not as simple as my posting implied. We had an expression in which
multiple truncations were taking place within an equation, but it did
finally dawn on us that it was because we were using integers
throughout.

So the lessons are:

a. Don't post stuff until you understand it adequately (let me know if
you disagree, Marcus!)

b. As Einstein figured out, sometimes things are counterintuitive in a
world where everything's discrete instead of continuous

A thousand pardons,

Steve
-- 
address@hidden
Lang, Railsback & Assoc.
250 California Ave., Arcata CA 95521
707-822-0453; Fax 822-1868

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]