diff --git a/Programming-language-specification-(Gemstone).md b/Programming-language-specification-(Gemstone).md index d5d52e0..0b8a263 100644 --- a/Programming-language-specification-(Gemstone).md +++ b/Programming-language-specification-(Gemstone).md @@ -8,12 +8,15 @@ The most fundamental types of data. They provide the base upon everything else i | `int` | 4 | signed integer stored as two's complement with the MSB representing the sign bit | | `float` | 4 | signed single precision floating point as specified by IEEE-754 | +### Automatic type coercion +Primitive types `int` and `float` are automatically converted into each other upon need. This is a lossy conversion. A float may not have the precision to store every digit of a given integer. Likewise the fraction of any float will be truncated. + ## Composite data types Primitive data types provide the foundation upon which direct derivations can be built. The derivations of primitive types we call composite types. A composite type modifies or extends the definition of a primitive or another composite type. Extensions or modifications can mean adding or removing a sign bit, exchanging the arithmetic model, etc. The declaration of a composite data type is made with the following syntax: -`typedef $name` +` = $name` ### Sign The `` is a keyword specifying whether to implement a sign bit or not. Possible values are: