Converting double to integer using fint() is not working. Is there any alternative for this?

57 views Asked by At

I want to convert 1.8 to 2.0 and then change the type of the result to an integer value i.e., 2. To do this, I execute the following function for the shown template.

int xx;
double dx=round(1.8);
void cast() { xx = fint(dx); }

enter image description here

Upon execution, the value of xx is still 0. Could someone please help me figure this out.

1

There are 1 answers

0
mariusm On

Floating point operations are supported only in SMC queries.

Please try the following query:

simulate [<=100] {xx, dx}