19 lines
464 B
Markdown
19 lines
464 B
Markdown
# Float
|
|
|
|
`Float` is the primitive type constraint for floating-point values.
|
|
|
|
## Examples
|
|
|
|
```dcdl
|
|
ratio = Float;
|
|
threshold = Float default 0.5;
|
|
```
|
|
|
|
## Relationship to Int
|
|
|
|
`Int` and `Float` are distinct primitive type constraints.
|
|
A `Float` constraint requires a concrete `Float`, and an `Int` constraint requires a concrete `Int`.
|
|
|
|
Arithmetic and comparison expressions can treat `Int` and `Float` as numeric values.
|
|
Mixed arithmetic produces a `Float` result.
|