mirror of https://github.com/ecmwf/eccodes.git
Rounding issues
This commit is contained in:
parent
6eb9ef3b45
commit
456bdd2128
|
@ -427,9 +427,9 @@ static int angle_can_be_encoded(const double angle, const double angular_precisi
|
|||
{
|
||||
const double angle_expanded = angle * angular_precision;
|
||||
Assert(angular_precision>0);
|
||||
double rounded = (int)(angle_expanded+0.5)/angular_precision;
|
||||
double rounded = (long)(angle_expanded+0.5)/angular_precision;
|
||||
if (angle<0) {
|
||||
rounded = (int)(angle_expanded-0.5)/angular_precision;
|
||||
rounded = (long)(angle_expanded-0.5)/angular_precision;
|
||||
}
|
||||
if (angle == rounded) return 1;
|
||||
/*printf(" ......... angle cannot be encoded: %.10e\n", angle);*/
|
||||
|
|
Loading…
Reference in New Issue