Index: /trunk/BNS/bnseph.cpp
===================================================================
--- /trunk/BNS/bnseph.cpp	(revision 925)
+++ /trunk/BNS/bnseph.cpp	(revision 926)
@@ -388,2 +388,12 @@
 }
 
+// Glonass IOD
+////////////////////////////////////////////////////////////////////////////
+int t_ephGlo::IOD() const {
+  ////  return int(fmod(_GPSweeks,86400.0)) / 600;
+  unsigned int tb  = int(fmod(_GPSweeks,86400.0)) * 1000; // msec of day
+
+  // 5 LSBs of iod are equal to 5 LSBs of tb, remaining bits are zero
+  unsigned int iod = tb << 3;
+  return (iod >> 3);
+}
Index: /trunk/BNS/bnseph.h
===================================================================
--- /trunk/BNS/bnseph.h	(revision 925)
+++ /trunk/BNS/bnseph.h	(revision 926)
@@ -37,5 +37,5 @@
   virtual void position(int GPSweek, double GPSweeks, ColumnVector& xc,
                         ColumnVector& vv) const;
-  virtual int  IOD() const {return int(fmod(_GPSweeks,86400.0)) / 600;}
+  virtual int  IOD() const;
  private:
   static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv);
