Boost logo

Boost :

From: d.frey_at_[hidden]
Date: 2000-11-29 13:45:56


Hi,

besides the constrution from double and/or from string, the same
problem may be true for operators:

  rational<int> a,b,c;

  a = 42;
  b = 1764;

  c = a * 0.7 + b;

Possible, if there is a ctor taking a double or if there are special
operators for these cases. Again, inaccuracy is a problem. Without
these problems but looking strange:

  c = a * "0.7" + b;

I personally prefer the string approach. A conversion function that
has to be called explicitly would make the whole code unreadable. Or
the user has to write:

  c = a * 7 / 10 + b;

Hm... well... I don't know what's relevant, best, appropriate... just
a though...

Regards, Daniel


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk