Why use "return (null);" instead of "return null;" ?

S

sgeos

Patricia said:
I think you are making the logic error of assuming that identities that
are true in some arithmetic systems, such as real number arithmetic,
necessarily apply to other arithmetic systems.

I think you hit the nail on the head. What arithmetic systems does
Java operate in?

-Brendan
 
P

Patricia Shanahan

sgeos said:
I think you hit the nail on the head. What arithmetic systems does
Java operate in?

The authoritative source is the JLS. Section 15, Expressions, at
http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#44393
begins with some general rules, followed by details for each combination
of type and operation.

There are two main flavors of arithmetic, integer (int and long), and
floating point (float and double). The JLS defines arithmetic for the
other integer types only in terms of conversions and int arithmetic.

The integer types both behave like 2's complement binary. It is
arithmetic modulo 2^N (Using "^" for exponentiation) where N is 32 or
64, but treated as a signed range where it matters. Addition,
subtraction, and multiplication can cause wrap-around.
Integer.MAX_VALUE+1 is equal to Integer.MIN_VALUE. Division rounds
towards zero to get an integer value.

The floating point types are, effectively, IEEE 754 32 bit and 64 bit
binary floating point. They suffer from the usual limitations of
floating point, including rounding error that can make even addition
non-associative.

Patricia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top