| View: | Hide Browser | Browser on the left | Browser on the right | Dictionary |
| Report: | General Info | Attributes | Operations | Constraints |
| Attributes | ||||
| Signature | Optionality | Multiplicity | Constant | Documentation |
| 1 | -- | denominator of ratio | ||
| 1 | -- | numerator of ratio | ||
| 0..1 | -- | Precision to which the numerator and denominator values of the proportion are expressed, in terms of number of decimal places. The value 0 implies an integral quantity. The value -1 implies no limit, i.e. any number of decimal places. | ||
| 1 | -- | Indicates semantic type of proportion, including percent, unitary. Codes are given in PROPORTION_KIND class. | ||
| Operations | ||
| Signature | Constraints | Documentation |
|
post: other.type implies result | True if type is the same. | |
|
post: Result = numerator/denominator | Effective magnitude represented by ratio. | |
| Constraints | ||
| Name | Expression | |
| Is_integral_validity | inv: is_integral implies (numerator.floor = numerator and denominator.floor = denominator) | |
| Type_validity | inv: valid_proportion_kind(type) | |
| Fraction_validity | inv: (type = pk_fraction or type = pk_integer_fraction) implies is_integral | |
| Unitary_validity | inv: type = pk_unitary implies denominator = 1 | |
| Percent_validity | inv: type = pk_percent implies denominator = 100 | |
| Precision_validity | inv: precision = 0 implies is_integral | |