alamb commented on issue #1779:
URL: https://github.com/apache/arrow-rs/issues/1779#issuecomment-1146590989

   I think "Fixed Width Decimal" is a fairly common concept and is used for 
some specialized usecases (like currency), and I think the arrow spec basically 
follow the standard practice. 
https://en.wikipedia.org/wiki/Fixed-point_arithmetic#Representation 
   
   Like  @jorgecarleitao , I don't see the problem. 
   
   > 1000 or 0.0001. Do these have 4 digits or 1 digit? If they have 1 digit, 
how many digits do they have past the decimal point?
   
   I think the better question is "how would these be represented in different 
Decimal types"
   
   For `Decimal(5, 1)` they would be represented by `i128`s with the values 
`10000` and `00001` respectively
   
   You could also represent `1000` as `Decimal(5, 0)` with `i128` value 10000 
or `Decimal(4,0)` with `i128` value `1000`.
   
   > In particular with the current rust definition it is unclear how to 
represent numbers with more than 38 digits 
   
   I do not think that is possible. The reason being that `i128::MAX` is 
`170141183460469231731687303715884105727`, which can represent only 38 decimal 
digits


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to