/*-*-C++-*------------------------------------------------------------------
 * gaol -- Just Another Interval Library
 *--------------------------------------------------------------------------
 * This file is part of the gaol distribution. Gaol was primarily 
 * developed at the Swiss Federal Institute of Technology, Lausanne, 
 * Switzerland, and is now developed at the Institut de Recherche 
 * en Informatique de Nantes, France.
 *
 * Copyright (c) 2001 Swiss Federal Institute of Technology, Switzerland
 * Copyright (c) 2002 Institut de Recherche en Informatique de Nantes, France
 *--------------------------------------------------------------------------
 * gaol is a software distributed WITHOUT ANY WARRANTY. Read the associated 
 * COPYING file for information.
 *--------------------------------------------------------------------------
 * CVS: $Id: gaol_interval_generic.h,v 1.6 2006/03/22 08:35:14 goualard Exp $
 * Last modified: Fri Feb 20 10:15:30 2004 on victory.irin.sciences.univ-nantes.fr
 * By: Frédéric Goualard <Frederic.Goualard@lina.univ-nantes.fr>
 *--------------------------------------------------------------------------*/

/*!
  \file   gaol_interval_generic.h
  \brief  Non-portable part of the interval methods. Generic version in C.

  <long description>

  \warning This version can only be used if the underlying architecture
  uses 64 bits-long floating-point registers.

  \author Frédéric Goualard
  \date   2001-11-12
*/


#ifndef __gaol_interval_generic_h__
#define __gaol_interval_generic_h__

INLINE interval& interval::operator+=(const interval& I)
  {
    GAOL_RND_UP();
    lb_  = -((-left())-I.left());
    rb_ += I.right();
    return *this;
  }
  
INLINE interval& interval::operator-=(const interval& I)
  {
    GAOL_RND_UP();
    lb_  = -(I.right()-left());
    rb_ -= I.left();
    return *this;
  }

INLINE interval& interval::operator+=(double d)
  {
    GAOL_RND_UP();
    lb_  = -((-left())-d);
    rb_ += d; 
    return *this;
  }

INLINE interval& interval::operator-=(double d)
  {
    GAOL_RND_UP();
    lb_  = -(d-left());
    rb_ -= d;
    return *this;
  }



#endif /* __gaol_interval_generic_h__ */
