VARIANT data: Casting some of the fixed numeric values to floating-point results in different approximate values (Pending)

注意

此行为变更包含在 2025_07 捆绑包中。

有关捆绑包的当前状态,请参阅 捆绑包历史记录

When this bundle is enabled and you extract a fixed numeric value from a VARIANT value and cast the numeric value to a floating-point type, the resulting value might be different.

This behavior change occurs in cases when the cast is narrow --- in other words, when the cast type cannot hold the value. The cast might return a different approximate value that is closer to the original value.

例如,当 VARIANT 列中的固定数值 264208207.9326154526043824 被类型转换为 FLOAT 时,行为变更前后的结果值不同:

  • 原始数值(类型转换为 FLOAT 前):

    264208207.9326154526043824
    
    Copy
  • 行为变更之前(类型转换为 FLOAT 之后)的数值:

    264208207.93261543
    
    Copy
  • 行为变更后的数值(类型转换为 FLOAT 之后):

    264208207.93261546
    
    Copy

引入此行为变更是为了使类型转换结果与非 VARIANT 数值的类型转换保持一致。

参考:2106

语言: 中文