Numerical typesMathematically, numbers are arranged into a tower of subtypes in which each level is a subset of the level above it:
For example, 3 is an integer. Therefore 3 is also a rational, a real, and a complex number. The same is true of the Scheme numbers that model 3. For Scheme numbers, these types are defined by the predicates number?, complex?, the same integer. Scheme's numerical operations treat numbers as abstract data, as independent of their representation as possible. Although Husk may use multiple internal representations of numbers, this ought not to be apparent to a casual programmer writing simple programs. |