haskell-phrasebook icon indicating copy to clipboard operation
haskell-phrasebook copied to clipboard

Types of numbers

Open chris-martin opened this issue 6 years ago • 0 comments

This would be sort of a followup to common types that goes more in depth on numbers.

  • Signed integers: Integer, Int8, Int16, Int32, Int64
  • Unsigned integers: Natural, Word8, Word16, Word32, Word64
  • Int and Word are hardware-specific type aliases (e.g. Int is probably Int32 or Int64 on a 32-bit or 64-bit processor)
  • Floating point: Float, Double
  • The default types for numeric literals are Integer for whole numbers are Double for fractions.
  • Also: Complex, Ratio, Rational
  • Conversions between types of numbers

If there are too many things to show, this topic might span multiple examples.

chris-martin avatar Sep 30 '19 20:09 chris-martin