dss-extensions / dss-extensions/dss_capi

Parser truncates values

Open
#95 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Pascal
Stars
39
Forks
19
PR merge metrics
No merged PRs in 30d

Description

The OpenDSS parser uses the [Val function](https://www.freepascal.org/docs-html/rtl/system/val.html), e.g.

https://github.com/dss-extensions/dss_capi/blob/0ef72db7eb046ad5d7a3731ff5ea33b8089b728c/src/Parser/ParserDel.pas#L792

Most integers in OpenDSS are 32-bit values. If the input is larger than the max value, the value is truncated (upper bits dropped).

The results in DSS C-API are the same as in the official binaries, but we could add optional error messages to warn of this behavior.

Since the values are truncated instead of clipped to max/min, this can be dangerous.

Low priority.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.