Skip to content

Support basic math constants #15

@cmpute

Description

@cmpute

Support the following math constants under the dashu_float::consts module:

  • e(precision: usize) -> FBig<B, R>
  • pi(precision: usize) -> FBig<B, R>
  • ln2(precision: usize) -> FBig<B, R>
  • ln10(precision: usize) -> FBig<B, R>
  • sqrt2(precision: usize) -> FBig<B, R> (ref)

Furthermore, we might consider create a global buffer to store commonly used math constants (specifically pi, ln2 and ln10). This requires one of the following modifications:

  1. the context stores an Rc to the constants. In that case, the Context will be !Send and !Sync and we need to inform users that only Repr is Send and Sync.
  2. adding a global buffer (per thread / cross thread). This should be gated by a feature option, and we should provide a function (maybe associated with the Context type) to clear the buffer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions