CMP Conversion Amanuensis
Last updated 2004-06-28 by Roedy
Green ©1996-2004 Canadian Mind Products
This Applet will help you write Java code. Instead of memorising the 400 conversion functions between the 20 basic types, just use this amanuensis to generate the code, the paste it into your source.
This Applet requires one of the following up-to-date browsers:
| details about the current version. | download source and executable to run this Applet on your own machine as a stand-alone application. |
If the Applet does not work for you, try the 20x20 matrix crib sheet
| Type | Signed? | Bits | Bytes | Lowest | Highest | Mnemonic |
|---|---|---|---|---|---|---|
| boolean | n/a | 1 | 1 | false | true | zero/one |
| char | unsigned Unicode | 16 | 2 | '\u0000' [0] aka Character.MIN_VALUE | '\uffff' [216-1] aka Character.MAX_VALUE | Unicode chars are twice as big as C's. |
| byte | signed | 8 | 1 | -128 [-27] aka Byte.MIN_VALUE | +127 [27-1]aka Byte.MAX_VALUE | Bytes are signed, so half the usual 255 range. |
| short | signed | 16 | 2 | -32,768 [-215] aka Short.MIN_VALUE | +32,767 [215-1] aka Short.MAX_VALUE | 32K |
| int | signed | 32 | 4 | -2,147,483,648 [-231] aka Integer.MIN_VALUE | +2,147,483,647 [231-1] aka Integer.MAX_VALUE | 2 gig |
| long | signed | 64 | 8 | -9,223,372,036,854,775,808 [-263] aka Long.MIN_VALUE | +9,223,372,036,854,775,807 [263-1] aka Long.MAX_VALUE | 9 exabytes, or 9 billion gig |
| float | signed exponent and mantissa | 32 | 4 | ±1.40129846432481707e-45 | ±3.40282346638528860e+38
with 6 to 7 significant digits of accuracy. |
rough float |
| double | signed exponent and mantissa | 64 | 8 | ±4.94065645841246544e-324 | ±1.79769313486231570e+308
with 14 to 15 significant digits of accuracy. |
high precision float |
| Mutable Primitives | Immutable Objects |
|---|---|
| boolean | Boolean |
| ordinary signed byte | Byte |
| unsigned byte | Byte |
| short | Short |
| char | Character |
| int | Integer |
| long | Long |
| float | Float |
| double | Double |
| char[] | String |
home |
Canadian Mind Products | |||
| mindprod.com IP:[24.87.56.253] | ||||
| Your IP:[80.134.30.163] | ||||
| You are visitor number 41422. | ||||
| Please send errors, omissions and suggestions | ||||
| to improve this page to Roedy Green. | ||||
| You can get a fresh copy of this page from: | or possibly from your local J: drive mirror: | |||
| http://mindprod.com/converter.html | J:\mindprod\converter.html | |||