3 Apr
2005
3 Apr
'05
10:08 a.m.
I need a type equivelant to rational<int> but supporting two special values, +inf and -inf which compare greater and less (respectively) to all other values besides themselves. I don't need to perform any arithmetic on the inf values so those operations can be undefined. What is the best strategy for creating such a type? Would it be better to subclass rational or create an underlying integer type with the inf values and use rational based on that underlying type? If the former option, how exactly would I do it?