You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Wes McKinney (JIRA)" <ji...@apache.org> on 2017/11/11 23:59:00 UTC
[jira] [Resolved] (ARROW-1800) [C++] Fix and simplify
random_decimals
[ https://issues.apache.org/jira/browse/ARROW-1800?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Wes McKinney resolved ARROW-1800.
---------------------------------
Resolution: Fixed
Issue resolved by pull request 1306
[https://github.com/apache/arrow/pull/1306]
> [C++] Fix and simplify random_decimals
> --------------------------------------
>
> Key: ARROW-1800
> URL: https://issues.apache.org/jira/browse/ARROW-1800
> Project: Apache Arrow
> Issue Type: Bug
> Components: C++
> Affects Versions: 0.7.1
> Reporter: Phillip Cloud
> Assignee: Phillip Cloud
> Labels: pull-request-available
> Fix For: 0.8.0
>
>
> {{UniformDecimalDistribution}} currently generates values outside the range specified for the given precision in cases where the number of bytes required to represent a decimal value was less than or equal to 8.
> For example, for a 1 byte value the range is -128, 127 for the low bits and -1, 0 for the high bits. In cases where the low bits generated a negative number and the high bits generated a zero value the number can end up being much larger than desired.
> It's much easier to just generate {{N}} random bytes and sign extend based on the sign bit of the last byte.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)