Changeset 98778a7 in tol


Ignore:
Timestamp:
Mar 26, 2013, 10:22:40 AM (14 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
1af36f5
Parents:
a6be476
Message:

Fixes #1643 in tol 3.2

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@5704 be4846ae-f051-483a-831f-b64e7d08527f

Location:
tol/btol/timeset_type
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tol/btol/timeset_type/tms.cpp

    ra6be476 r98778a7  
    723723  CheckCache(this);
    724724  if(nth == 0) { return((!dte.HasValue()||Includes(dte))?dte:BDate::Unknown()); }
     725  if(nth == -nth)
     726  {
     727    return(BDate::End());
     728  }
    725729  if(nth <  0) { return(Prev(dte, -nth)); }
    726730  if(dte.IsTheEnd()) { return(BDate::End()); }
    … …  
    770774  CheckCache(this);
    771775  if(nth == 0) { return((!dte.HasValue()||Includes(dte))?dte:BDate::Unknown()); }
     776  if(nth == -nth)
     777  {
     778    return(BDate::Begin());
     779  }
    772780  if(nth <  0) { return(Next(dte, -nth)); }
    773781  if(dte.IsTheBegin()) { return(BDate::Begin()); }
  • tol/btol/timeset_type/tmsgrav.cpp

    ra6be476 r98778a7  
    15911591//--------------------------------------------------------------------
    15921592{
    1593   if(x.IsUnknown() || x.IsTheEnd ())
     1593  if(x.IsUnknown() || x.IsTheEnd () || x.IsTheBegin ())
    15941594  { return(x); }
    15951595  if(n==0)  { return(icu_->Successor(x)); }
    … …  
    16101610  {
    16111611    r *= 2;
     1612    if(r==-r)
     1613    {
     1614      return(BDate::End());
     1615    }
    16121616    if(ua>x)
    16131617    {
    … …  
    16751679//--------------------------------------------------------------------
    16761680{
    1677   if(x.IsUnknown() || x.IsTheBegin ())
     1681  if(x.IsUnknown() || x.IsTheBegin () || x.IsTheEnd ())
    16781682  { return(x); }
    16791683  if(n==0)  { return(icu_->Predecessor(x)); }
    … …  
    16941698  {
    16951699    r *= 2;
     1700    if(r==-r)
     1701    {
     1702      return(BDate::Begin());
     1703    }
    16961704    if(ua>=x)
    16971705    {
Note: See TracChangeset for help on using the changeset viewer.