Incorrect rounding at compile time going from double to int.

This commit is contained in:
Christoffer Lerno
2025-04-07 02:36:04 +02:00
parent 4c26adb376
commit 8cce7f6836
4 changed files with 20 additions and 17 deletions

View File

@@ -0,0 +1,14 @@
module float_ct;
fn void float_ct() @test
{
var $input = 3e25;
var $temp = (int128)$input;
var $temp2 = (double)$temp;
test::eq_approx($temp2, 3e25);
var $input2 = -3e25;
var $temp3 = (int128)$input2;
var $temp4 = (double)$temp3;
test::eq_approx($temp4, -3e25);
}