Skip to content

division decimal: lose precision when convert i128 to f64 #2259

@liukun4515

Description

@liukun4515

But now I find a bug in the arithmetic operation. https://github.com/apache/arrow-datafusion/blob/c91efc27658e58264c4f346a5cfdec8810179e90/datafusion/physical-expr/src/expressions/binary.rs#L302 and https://github.com/apache/arrow-datafusion/blob/c91efc27658e58264c4f346a5cfdec8810179e90/datafusion/physical-expr/src/expressions/binary.rs#L307

In the divide method, we may lose of precision by converting the i128 to f64.
We use the f64 to store the larger range of data, but we lose the precision.

I will try to figure out this issue and resolve this.

Originally posted by @liukun4515 in #2233 (comment)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions