X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fgmprat.h;h=5df43ef85f77e33e9eb3527dd959b433e665601a;hp=de0e80b0387cc1cef28cdffc7c5edcfb90dda277;hb=58a6719da2337b3e6e20b581885f170bbe5fc480;hpb=2d12d37f1657d6aef9bb80d735b6c7022aecba6e diff --git a/src/gmprat.h b/src/gmprat.h index de0e80b..5df43ef 100644 --- a/src/gmprat.h +++ b/src/gmprat.h @@ -32,6 +32,7 @@ class Gmprat } Gmprat & operator=(const Gmprat & equ) {mpq_set(m_op, equ.m_op); return *this;} + Gmprat & operator=(const double & equ) {mpq_set_d(m_op, equ); return *this;} Gmprat & operator+=(const Gmprat & add) {mpq_add(m_op, m_op, add.m_op); return *this;} Gmprat & operator-=(const Gmprat & sub) {mpq_sub(m_op, m_op, sub.m_op); return *this;} Gmprat & operator*=(const Gmprat & mul) {mpq_mul(m_op, m_op, mul.m_op); return *this;}