From 6cefb85bc32208fec1524a7d1cf3c20d8ce21c15 Mon Sep 17 00:00:00 2001 From: kaizhangNV <149626564+kaizhangNV@users.noreply.github.com> Date: Wed, 20 Mar 2024 08:48:13 -0700 Subject: Change representation of float literal in language translation (#3798) * Change representation of float literal in language translation Fix the issue (#3490). Previous implementation could zero out the very small float literal. We now use scientific notation instead to represent the float numbers whose exponential part are larger than a threshold. In other cases, keep using fixed notation. --------- Co-authored-by: Yong He --- tests/bugs/gh-3589.slang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/bugs/gh-3589.slang b/tests/bugs/gh-3589.slang index 58bb74f37..4534465d3 100644 --- a/tests/bugs/gh-3589.slang +++ b/tests/bugs/gh-3589.slang @@ -11,8 +11,8 @@ void main(uint id: SV_DispatchThreadID) outputBuffer[0] = i; outputBuffer[1] = m; - // CHECK: -179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0 + // CHECK: -1.79769313486231571e+308 outputBuffer2[0] = double.minValue; - // CHECK: 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0 + // CHECK: 1.79769313486231571e+308 outputBuffer2[1] = double.maxValue; } \ No newline at end of file -- cgit v1.2.3