There are other surprises. You might then expect byte * byte to be a byte, char * char to be a char, short * short to be a short, but they are not. All of them result in an int.
Further, byte and short are sign extended to int before the multiply.
long * long gives a long, again truncating without overflow notification. long * int also gives a long.
Floating point, (float and double) works quite differently. float * float gives a float and double * double gives a double. double * float also gives a double. Floating point warns you when the multiply fails by giving NaN (Not A Number) results.
This page is posted |
http://mindprod.com/jgloss/multiplication.html | |
Optional Replicator mirror
|
J:\mindprod\jgloss\multiplication.html | |
Please read the feedback from other visitors,
or send your own feedback about the site. Contact Roedy. Please feel free to link to this page without explicit permission. | ||
Canadian
Mind
Products
IP:[65.110.21.43] Your face IP:[18.226.93.139] |
| |
Feedback |
You are visitor number | |