diff options
author | Tom Musta <tommusta@gmail.com> | 2014-04-21 15:54:54 -0500 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2014-06-16 13:24:29 +0200 |
commit | 79af3572250352c5eeacdd813b57ad5ba748654c (patch) | |
tree | 6131a6ba98cbbcfda6b7a7a9569e32642b0e66fd /include/libdecnumber | |
parent | 8e706db21ecfba75da3f9f843f1fa36276085742 (diff) | |
download | qemu-79af3572250352c5eeacdd813b57ad5ba748654c.zip qemu-79af3572250352c5eeacdd813b57ad5ba748654c.tar.gz qemu-79af3572250352c5eeacdd813b57ad5ba748654c.tar.bz2 |
libdecnumber: Introduce decNumberIntegralToInt64
Introduce a new conversion function to the libdecnumber library.
This function converts a decNumber to a signed 64-bit integer.
In order to support 64-bit integers (which may have up to 19
decimal digits), the existing "powers of 10" array is expanded
from 10 to 19 entries.
Signed-off-by: Tom Musta <tommusta@gmail.com>
[agraf: fix 32bit host compile]
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'include/libdecnumber')
-rw-r--r-- | include/libdecnumber/decNumber.h | 1 | ||||
-rw-r--r-- | include/libdecnumber/decNumberLocal.h | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/include/libdecnumber/decNumber.h b/include/libdecnumber/decNumber.h index f4bf994..9fa4e6a 100644 --- a/include/libdecnumber/decNumber.h +++ b/include/libdecnumber/decNumber.h @@ -122,6 +122,7 @@ char * decNumberToEngString(const decNumber *, char *); uint32_t decNumberToUInt32(const decNumber *, decContext *); int32_t decNumberToInt32(const decNumber *, decContext *); + int64_t decNumberIntegralToInt64(const decNumber *dn, decContext *set); uint8_t * decNumberGetBCD(const decNumber *, uint8_t *); decNumber * decNumberSetBCD(decNumber *, const uint8_t *, uint32_t); diff --git a/include/libdecnumber/decNumberLocal.h b/include/libdecnumber/decNumberLocal.h index f5f508f..cd4eb79 100644 --- a/include/libdecnumber/decNumberLocal.h +++ b/include/libdecnumber/decNumberLocal.h @@ -98,7 +98,7 @@ /* Shared lookup tables */ extern const uByte DECSTICKYTAB[10]; /* re-round digits if sticky */ - extern const uInt DECPOWERS[10]; /* powers of ten table */ + extern const uLong DECPOWERS[19]; /* powers of ten table */ /* The following are included from decDPD.h */ extern const uShort DPD2BIN[1024]; /* DPD -> 0-999 */ extern const uShort BIN2DPD[1000]; /* 0-999 -> DPD */ |