public void SetRationalValue (int directory, ushort entry_tag, double value) { if (value < 0.0d || value > (double)UInt32.MaxValue) throw new ArgumentException ("value"); uint scale = (value >= 1.0d) ? 1 : UInt32.MaxValue; Rational rational = new Rational ((uint) (scale * value), scale); SetEntry (directory, new RationalIFDEntry (entry_tag, rational)); }