Skip to content

Specialize pow for int.#43

Merged
ibell merged 1 commit intoCoolProp:masterfrom
jondebove:fastpow
Feb 17, 2024
Merged

Specialize pow for int.#43
ibell merged 1 commit intoCoolProp:masterfrom
jondebove:fastpow

Conversation

@jondebove
Copy link
Copy Markdown
Contributor

Improve performance by a factor 5.

Improve performance by a factor 5.
@ibell
Copy link
Copy Markdown
Contributor

ibell commented Feb 17, 2024

Looks good to me. Sometimes I handle this approach by changing the name of the function to powInt or something to make clear what magic is happening.

Note that with some compiler flags there is no difference in speed though I usually do the explicit handling of integer powers as you do here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants