1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <assert.h> #include "interval.hh" #include <math.h> const Real INFTY = HUGE; void Interval::set_empty() { min = INFTY; max = -INFTY; } Real Interval::length() const { assert(max >= min); return max-min; }