Skip to content

Numeric Tower #48

@iwillspeak

Description

@iwillspeak

Scheme has the idea of a heirachical tower of numbers. Currently we only support double to represent Scheme's real numbers. This is standards-compliant but a bit underwhelming.

We should expand the numeric support to cover more of the tower:

  • comple represented by System.Numerics.Complex.
  • real represented by System.Double
  • integer represented by Sytem.Int64.

It might also be possible to support on-demand widening of integers from int to BigInteger. This leaves most of the numeric tower, appart from rationals, covered.

To support this we'd need to update the arithmetics library to allow calling with any of the number types. We'd need to address any places where numbers are unpacked as arguments and handle the different numeric types.

Given that the general representation here will be of boxed values it may be worth modelling this out as a class heirachy rather than just handling all supported numeric types at all call sites.

Some things to think about:

  • Boxed or class representation
  • Constant folding and numeric specialisations
  • How is this orthogonal tot he string / mutable string representation issue.

See also:

Metadata

Metadata

Assignees

No one assigned

    Labels

    RoadmapLarger scale planned feature or tracking issuefeatureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions