Skip to content

Conversation

@chipbarnaby
Copy link
Contributor

Description

Motivation: standardize math-related declarations using cmath.

Prior to this change, cnglob.h included math.h. Some vendor headers included cmath. The Microsoft library can end up using different implementations of some functions (e.g. pow()) depending on include order. CSE results change when these alternative implementations are selected. Overall upshot -- adding or re-ordering includes of vendor headers could cause apparently unrelated results changes.

The primary code change in this PR is changing cnglob.h to #include <cmath>. Some redundant includes were removed. Related comments are updated.

Many regression tests show differences as a result of this change. Most are deemed trivial. In all cases, annual results are virtually unchanged. Larger and potentially significant changes are seen in hourly results in the following --

  • ashpvc2
  • chdhw
  • submeter
  • MF8X

@chipbarnaby
Copy link
Contributor Author

chipbarnaby commented Dec 18, 2023 via email

@chipbarnaby chipbarnaby merged commit 120b984 into main Dec 19, 2023
@chipbarnaby chipbarnaby deleted the cmath branch December 19, 2023 00:01
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.

3 participants