Require scale for integral conversions and RoundingMode for float 02/100102/4
authorRobert Varga <robert.varga@pantheon.tech>
Sun, 13 Mar 2022 13:04:24 +0000 (14:04 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sun, 13 Mar 2022 14:41:11 +0000 (15:41 +0100)
commita468678519c5b5390892997917cd3935f683a657
treeda5d4f6d6b5ab92deabb12b9660ae618b1e3309d
parent5526e6c9d69bd2c51b70b22927446720af688b2c
Require scale for integral conversions and RoundingMode for float

Integral conversions need to check range and take the intended scale,
otherwise we are left guessing as to what we need to do.

Similarly, float/double need to take RoudingMode, so that they can
figure out what to do with excess precision.

JIRA: YANGTOOLS-1405
Change-Id: I2a6eef9c987dcceec8de7e2aa5bbf43062301cf9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/Decimal64.java
common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/Decimal64Conversion.java [new file with mode: 0644]
common/yang-common/src/test/java/org/opendaylight/yangtools/yang/common/Decimal64Test.java
model/yang-model-ri/src/main/java/org/opendaylight/yangtools/yang/model/ri/type/NumberUtil.java
model/yang-model-ri/src/test/java/org/opendaylight/yangtools/yang/model/ri/type/NumberUtilTest.java
parser/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/TypedefConstraintsTest.java