Grids are defined in GRIB2 using an accuracy of 1/1000000 (one millionth) of a degree. If this accuracy is not sufficient to describe your grid (latitude/longitude of first and last points, as well as grid increments) without loss of information, you can use a GRIB2 feature that provides a way to describe any regular grid.
Explanation of i/j coordinates and how they are used to describe the encoded fields in GRIB 2 (and ecCodes):
Example of the most used GRIB 2 encoding
Scanning mode 0
|
...