Hello,
I have a basic question about mixing datatypes and operators in SV, probably there is a section in the LRM but I’m not sure which could it be
Let’s say you have
module test();
const int x = 10;
const int y = 10;
const real f= 0.95;
int z;
initial begin
z = (x*f)/y;
$display("x =%0d, y = %0d, f = %0f, z = %0d", x, y, f, z);
end
endmodule
This outputs
KERNEL: x =10, y = 10, f = 0.950000, z = 1
I was expecting to be computed something like this
1- (xf) = 100.95 = 9.5 => int’(9.5) = 9
2- z = 9/10 = 0
Probably I’m missing something very basic here not necessarily about SV (general programming), any hint on which section of the LRM covers this is really appreciated.