If you want to override those defaults, you can explicitly specify the data type of a numeric literal by appending a special character to its end. The following table shows the appending characters for some data types:
Type appending
character
Double R or #
Integer I or %
Long L or &
Short S
Single F or !
Here are some examples:
123 'is an integer 123L 'is a long integer 12.3 'is a double precision floating point number 12.3F 'is a single precision floating point number
You can use these appending characters to control the data types of your numeric literals.
You can also see the data types of a literal, named constant or variable in a program by placing the cursor over it -- a popup box will give the data type.
Disclaimer: The views and opinions expressed on unofficial pages of California State University, Dominguez Hills faculty, staff or students are strictly those of the page authors. The content of these pages has not been reviewed or approved by California State University, Dominguez Hills.