Dear all
I am using comparisons with variables in double precision and the problem is that extracting cell values to local macros changes precision. Here is an illustration of the problem:
The command assert should report an error, but it does not, because the value of `A' is different from the value of variable (this changes if one replaces the last digit of the number of line three by a digit below 5). For float variables I would use
, but there does not seem to be an equivalent function for double precision, such as
.
Any help appreciated.
I am using comparisons with variables in double precision and the problem is that extracting cell values to local macros changes precision. Here is an illustration of the problem:
Code:
clear set obs 1 gen double a = 2093.1234567891899 local A=a in 1 assert `A'>a noi di %20.18g `A' noi di %20.18g a
Code:
assert float(`A')>float(a)
Code:
assert double(`A')>double(a)
Any help appreciated.
Comment