J
jren
Guest
Hi,
I have two questions related to precision of float:
1.
In my SKILL code:
grid1 = 0.5
fprintf(stdout "grid1 = %.20f\n" grid1)
grid2 = 0.4
fprintf(stdout "grid2 = %.20f\n" grid2)
Output in CIW:
grid1 = 0.50000000000000000000
grid2 = 0.40000000000000002220
How can I get 0.4 = 0.4000000000000000 as 0.5?
2.
I tried to use function techSetPrecision(), but I am confused by the
following test:
techSetPrecision(2)
grid3 = 0.5553567
grid3 = grid3 * 1.0
fprintf(stdout "grid3 = %.20f\n" grid3)
In the CIW:
grid3 = 0.55535670000000003643
What I assume is grid3 should become 0.5600000 since I set precision
of number of digits in float as 2. Can anyone help me better
understand function techSetPrecision?
Thanks!
Jren
I have two questions related to precision of float:
1.
In my SKILL code:
grid1 = 0.5
fprintf(stdout "grid1 = %.20f\n" grid1)
grid2 = 0.4
fprintf(stdout "grid2 = %.20f\n" grid2)
Output in CIW:
grid1 = 0.50000000000000000000
grid2 = 0.40000000000000002220
How can I get 0.4 = 0.4000000000000000 as 0.5?
2.
I tried to use function techSetPrecision(), but I am confused by the
following test:
techSetPrecision(2)
grid3 = 0.5553567
grid3 = grid3 * 1.0
fprintf(stdout "grid3 = %.20f\n" grid3)
In the CIW:
grid3 = 0.55535670000000003643
What I assume is grid3 should become 0.5600000 since I set precision
of number of digits in float as 2. Can anyone help me better
understand function techSetPrecision?
Thanks!
Jren