comphead opened a new issue, #4577: URL: https://github.com/apache/arrow-rs/issues/4577
**Describe the bug** <!-- A clear and concise description of what the bug is. --> CAST f64 to Decimals gives incorrect result **To Reproduce** <!-- Steps to reproduce the behavior: --> Both Decimal128, Decimal256 are wrong ``` #[test] fn test_cast() { let array = Float64Array::from(vec![6.4053151420411946063694043751862251568]); let array = Arc::new(array) as ArrayRef; let casted_array = cast_with_options( &array, &DataType::Decimal256(38, 37), &CastOptions { safe: true, format_options: FormatOptions::default(), }, ).unwrap(); let casted_array = casted_array.as_primitive::<Decimal256Type>(); assert_eq!(casted_array.value_as_string(0), "6.4053151420411946063694043751862251568"); } ``` **Expected behavior** <!-- A clear and concise description of what you expected to happen. --> **Additional context** <!-- Add any other context about the problem here. --> Found on https://github.com/apache/arrow-datafusion/issues/7121 -- 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: github-unsubscr...@arrow.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org