| 1856 | /// \param b second operand |
| 1857 | /// \return \a a + \a b |
| 1858 | friend f31 operator+(f31 a, f31 b) |
| 1859 | { |
| 1860 | if(b.exp > a.exp) |
| 1861 | std::swap(a, b); |
| 1862 | int d = a.exp - b.exp; |
| 1863 | uint32 m = a.m + ((d<32) ? (b.m>>d) : 0); |
| 1864 | int i = (m&0xFFFFFFFF) < a.m; |
| 1865 | return f31(((m+i)>>i)|0x80000000, a.exp+i); |
| 1866 | } |
| 1867 | |
| 1868 | /// Subtraction operator. |
| 1869 | /// \param a first operand |