Skip to content

API 2.0 thoughts #10

Open
Open
@dereuromark

Description

@dereuromark

Currently, the API is as follows

Default scale vs required argument for scale

  • multiply() by default adds the scales of each number.
  • divide() requires a 2nd param scale, and right now the demo defaults to the max scale of the two numbers.
    So 1 and 2 result in 0 as the scale of that result cuts of the decimal values.

We could think to also auto-calculate scale for divide() as max($one->scale, $two->scale) of each elements scale similar to multiply().

Speaking API (no le, gt methods).

  • Not all the methods are fully speaking yet, sqrt(), pow() etc. Wonder if we want to make those more verbose or if those are already clear enough.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions