Am 01.03.2015 um 18:15 schrieb Alecos Papadopoulos:
In practice these two numbers are not totally identical. For example
I
obtain
2.8841797876482436
and
2.8841797876482445
A roundabout way to deal with the problem does exist: multiply by some
power of 10 representing desired precision in number of decimals, then
truncate using the function "int", then apply "ranking".
I was just wondering whether it would be worth the programming trouble
to enhance directly the "ranking" function so as to "look" only as
deep
as a user-specified number of decimals.
The same added functionality could be given to the function "round",
which currently only rounds to the nearest integer.
It could be a useful feature of Gretl in general, since it would give
the user the ability to specify what constitutes "equal" for his
specific situation, without the need to use the roundabout trick
described above.
I tend to agree that some way of defining "equal" in terms of
floating-point precision could be useful. Perhaps this could be done by
some 'set' option that would apply to all equal-comparisons in gretl,
instead of touching all the functions separately. I wouldn't be
surprised if somebody now points out that this already exists...
cheers,
sven