Skip to content

Improvements to power and multiply#55

Merged
ZCG-coder merged 12 commits intomainfrom
develop
Feb 2, 2025
Merged

Improvements to power and multiply#55
ZCG-coder merged 12 commits intomainfrom
develop

Conversation

@ZCG-coder
Copy link
Owner

@ZCG-coder ZCG-coder commented Feb 2, 2025

This PR addresses #52 #53 and #54. It brings the following to Steppable:

  • Improved performance to power with a new approximation method.
  • Improved performance with the ability to limit the number of decimals from multiply and power

This PR is not backwards-compatible with older code, as steppable::__internals::arithmetic is renamed to steppable::__internals::calc

Changelog
  • Added stubs for rounding_mode
  • Rename steppable::__internals::arithmetic
    steppable::__internals::arithmetic -> steppable::__internals::calc
  • Rename steppable::__internals::arithmetic
    steppable::__internals::arithmetic -> steppable::__internals::calc
  • Started using Result to replace std::string.
  • Addressed decimal rounding issues in multiply
    • [BREAKING] radToDeg and degToRad now require a const int decimals parameter,
    • multiply now takes a const int decimals parameter
    • multiply will now automatically round both numbers to desired
      precision before calculating the product, in order to reduce computation
      .
  • Fixes
  • Fix compile errors
  • Fix power sign issue
  • Add translations for multiply
  • Allow faster decimal power
    • Faster decimal power through exp and ln
    • More accurate exp by fixing a rounding bug
    • [DEV] Allow building all tests with make tests
    • Allow decimal option in power
  • Add decimal option to bindings

steppable::__internals::arithmetic -> steppable::__internals::calc
steppable::__internals::arithmetic -> steppable::__internals::calc
- [BREAKING] `radToDeg` and `degToRad` now require a `const int
decimals` parameter,
- `multiply` now takes a `const int decimals` parameter
- `multiply` will now automatically round both numbers to desired
precision before calculating the product, in order to reduce computation
.
@ZCG-coder ZCG-coder added T-Feature Type - New feature or request C-C++ Code - Pull requests that update C++ code. T-Improvement Type - Improvements to components. T-Translations Type - Translations for Steppable labels Feb 2, 2025
@ZCG-coder ZCG-coder added this to the First Release milestone Feb 2, 2025
@ZCG-coder ZCG-coder self-assigned this Feb 2, 2025
- Faster decimal power through `exp` and `ln`
- More accurate `exp` by fixing a rounding bug
- [DEV] Allow building all tests with `make tests`
- Allow `decimal` option in `power`
@ZCG-coder ZCG-coder marked this pull request as ready for review February 2, 2025 11:30
@ZCG-coder ZCG-coder requested a review from 813ethan February 2, 2025 11:30
@ZCG-coder ZCG-coder added the C-CMake Code - Pull requests that update CMake files. label Feb 2, 2025
Copy link
Collaborator

@813ethan 813ethan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, LGTM!

@ZCG-coder ZCG-coder merged commit 3edb3da into main Feb 2, 2025
41 checks passed
@ZCG-coder ZCG-coder added the W-Incompatible Warning - Breaking change label Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-C++ Code - Pull requests that update C++ code. C-CMake Code - Pull requests that update CMake files. T-Feature Type - New feature or request T-Improvement Type - Improvements to components. T-Translations Type - Translations for Steppable W-Incompatible Warning - Breaking change

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Feature: Use better approximation for power Feature: Add decimals parameter to power Bug: Incorrect power output for negative numbers

2 participants