1

Suppose you have a function that iterates x value over some kind of a range or an interval, like so:

for (x = MIN_CONST; x <= MAX_CONST; $x += STEP_CONST)
{
    //x is a ____ (what)?
    y = library_function(x);
    print y
}

An x value (out of sequential x values assigned inside the loop) can be seen as a "probe" or an "iterant", or "something".

I am looking for a defined, (or a better) name for this value.

If you like you can imagine a teacher explaining Newton's Method to students, and each x value gotten via the method would be called _____ what?

Vignesh Pichamani
  • 7,950
  • 22
  • 77
  • 115
Dennis
  • 7,907
  • 11
  • 65
  • 115
  • Maybe a ['domain value'](https://en.wikipedia.org/wiki/Domain_of_a_function) (for the transformation done inside the iterator)? Although that implies no concept of sequence or ordering. – user2864740 Sep 01 '15 at 23:31
  • It is not au courant, but the word *abscissa* for the x-coordinate and *ordinate* for the y-coordinate have a historical currency (related somewhat distantly to tables for aiming munitions). If I thought it would help those who maintained your code, I would make a stronger recommendation. – hardmath Sep 02 '15 at 01:21
  • In the context of functions, this is the input (variable) or the argument. – Nico Schertler Sep 02 '15 at 06:12

1 Answers1

2

The general word for this is loop control variable. See: loop control variable on Wikipedia

However, note that the two examples you are giving are not quite the same.

In the first case (i.e. in the for-loop) I would say that your x is basically a loop counter that you are using as an input argument for a function. (Although loop counter is not quite precise, since you are not requiring it to be an integer.). If you call it a loop control variable or a function argument/parameter/input depends merely from how you look at it - the way you are using it it is both.

OTOH in the example with the newton method where the x variable at step i, a.k.a. x_i, is called the i-th approximation or i-th iteration of x. At least it is what they call it in the wikipedia article about iterative methods. I think our professor usually just said "the x_i".

Personally, I often call them the running variable (probably just a literal translation from my german-speaking background 'Laufvariable') or simply the loop variable - but I don't think these are official terms or anything. Still people usually understand what I mean.

Am_I_Helpful
  • 18,735
  • 7
  • 49
  • 73
dingalapadum
  • 2,077
  • 2
  • 21
  • 31