This is an automated email from the ASF dual-hosted git repository.

morrysnow pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new 0325b3597ca branch-3.1: [fix](decimal256) fix unstable overflow error 
when casting decimal256 to float #56848 (#57503)
0325b3597ca is described below

commit 0325b3597ca6e93feb04c0d5b2371c8b01628521
Author: TengJianPing <[email protected]>
AuthorDate: Tue Nov 4 10:00:11 2025 +0800

    branch-3.1: [fix](decimal256) fix unstable overflow error when casting 
decimal256 to float #56848 (#57503)
    
    Picked from #56848
---
 be/src/vec/data_types/data_type_decimal.h | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/be/src/vec/data_types/data_type_decimal.h 
b/be/src/vec/data_types/data_type_decimal.h
index 1cfa54c8462..dd8b77f3270 100644
--- a/be/src/vec/data_types/data_type_decimal.h
+++ b/be/src/vec/data_types/data_type_decimal.h
@@ -604,13 +604,8 @@ void convert_from_decimal(typename ToDataType::FieldType* 
dst,
         } else {
             auto multiplier = FromDataType::get_scale_multiplier(scale);
             for (size_t i = 0; i < size; ++i) {
-                if constexpr (IsDecimal256<FromFieldType>) {
-                    dst[i] = static_cast<ToFieldType>(static_cast<long 
double>(src[i].value) /
-                                                      static_cast<long 
double>(multiplier.value));
-                } else {
-                    dst[i] = 
static_cast<ToFieldType>(static_cast<double>(src[i].value) /
-                                                      
static_cast<double>(multiplier.value));
-                }
+                dst[i] = 
static_cast<ToFieldType>(static_cast<double>(src[i].value) /
+                                                  
static_cast<double>(multiplier.value));
             }
         }
         if constexpr (narrow_integral) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to