Changeset 2d517f2 in tol


Ignore:
Timestamp:
Nov 26, 2009, 9:01:02 AM (17 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
047c98d
Parents:
389cf33
Message:

Fixes #286
Relates to #784

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/btol/set_type/setgra.cpp

    r389cf33 r2d517f2  
    780780    return;
    781781  }
    782   double from = fromDat.Value();
     782  double from  = fromDat.Value();
    783783  double until = untilDat.Value();
    784   double step = stepDat.Value();
     784  double step  = stepDat.Value();
    785785  int k;
    786786  double x;
    787   if (step == 0.0) { /* warning!!! : this is a bad comparison */
     787  if(step == 0.0) { /* warning!!! : this is a bad comparison */
    788788    Warning(I2("Argument 'p' of function Range cannot be zero",
    789789               "El argumento 'p' de la función Range no puede ser cero."));
    790790    return;
    791791  }
    792   for(k=0;;k++)
     792  if(((step>0.0)&&(until<from))||
     793     ((step<0.0)&&(until>from))) { return; }
     794  int K = 1+(int)floor(1.0+fabs((from-until)/step)-1.0);
     795  for(k=0; k<K; k++)
    793796  {
    794     x = from + step*k;
    795     if((step>0)?(x>until):(x<until)) { break; }
     797    x = 1.0 + (from + step*k) -1.0;
    796798    LstFastAppend(result, aux, new BContensDat("",x));
    797799  }
Note: See TracChangeset for help on using the changeset viewer.