Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numeric Tower #48

Open
iwillspeak opened this issue Nov 13, 2021 · 0 comments
Open

Numeric Tower #48

iwillspeak opened this issue Nov 13, 2021 · 0 comments
Labels
feature New feature or request Roadmap Larger scale planned feature or tracking issue

Comments

@iwillspeak
Copy link
Owner

iwillspeak commented Nov 13, 2021

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:

@iwillspeak iwillspeak added feature New feature or request Roadmap Larger scale planned feature or tracking issue labels Nov 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request Roadmap Larger scale planned feature or tracking issue
Projects
None yet
Development

No branches or pull requests

1 participant