I have this constant:
#define MAX_DATE 2958465L
What does the L mean in this sense?
The C Programming Language says: An integer constant like 1234 is an int . A long constant is written with a terminal l (ell) or L , as in 123456789L ; an integer constant too big to fit into an int will also be taken as a long .
Because R's integers are 32-bit long integers and "L" therefore appears to be sensible shorthand for referring to this data type.
The l-value expression designates (refers to) an object. A non-modifiable l-value is addressable, but not assignable. A modifiable l-value allows the designated object to be changed as well as examined.
Integer literals are numbers that do not have a decimal point or an exponential part. They can be represented as: Decimal integer literals. Hexadecimal integer literals. Octal integer literals.
It is a long
integer literal.
Integer literals have a type of int
by default; the L
suffix gives it a type of long
(Note that if the value cannot be represented by an int
, then the literal will have a type of long
even without the suffix).
In this scenario the L
does nothing.
The L
after a number gives the constant the long
type, but because in this scenario the constant is immediately assigned to an int
variable nothing is changed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With