[ 
https://issues.apache.org/jira/browse/PIG-2406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13167559#comment-13167559
 ] 

Vivek Padmanabhan commented on PIG-2406:
----------------------------------------

IMHO we should be having a UDF (in piggybank?) for rounding based on precision 
setting and may be UDF in piggybank for sum using BigDecimal.
Users can have a choice based on their requirements.

Another note is that,  users comparing the results of Pig 0.8 and Pig 0.9. For 
the above case;
Result in 0.8 = 60.23999999999997
Result in 0.9 = 60.24000000000001 (due to invocation of combiners)

                
> Improve double precision 
> -------------------------
>
>                 Key: PIG-2406
>                 URL: https://issues.apache.org/jira/browse/PIG-2406
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Anitha Raju
>
> Hi,
> When 2.51 (type: double) is added 24 times using SUM, it gives you result of 
> 60.23999999999997. 
> If a user wants to control the precision, that is, in the result he requires 
> 60.24, it wouldnt be possible unless he implements a custom UDF.
> So if we can have a way to improve double precision, 
> for eg: http://docs.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html
> Here with BigDecimal, one can improve the double precision and with 
> MathContext, the user has control to set the precision.
> Can we have a new UDF which can do the same?
> Regards,
> Anitha

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to