June 2005
Beginner
480 pages
10h 31m
English
Perl has two different types of scalar constants called literals: numeric literals and string literals.
Numeric literals are numbers, and Perl accepts several different ways of writing numbers. All the examples shown in Table 2.1 are valid numeric literals in Perl.
| Number | Type of Literal |
|---|---|
| 6 | An integer |
| 12.5 | A floating point number |
| 15. | Another floating point number |
| .7320508 | Yet another floating-point number |
| 1e10 | Scientific notation |
| 6.67E - 33 | Scientific notation (e or E is acceptable) |
| 4_294_296 | A large number with underscores instead of commas |
Numbers are expressed as you think they would be. Integers are just groups of consecutive digits. Floating-point decimal numbers contain a decimal point in the correct ...
Read now
Unlock full access