views:

51

answers:

3

It would hold a string and have characters (numeric, or decimal point) added and removed from the right end. Ignore the case of negative numbers for simplicity.

Does this kind of data structure have an agreed-upon name? Register? Buffer? Display? Something else?

UPDATE: This is an internal representation and may not be the final form of some calculation. It may be the inputs to some later calculation (after turning it into a number, of course).

+2  A: 

I wouldn't say there's an "agreed-upon" name; after all, I doubt there's a standards body whose job it is to review these things. That said, maybe you'll find one of these acceptable:

  • Answer
  • Result
  • Value
  • Digits
John Feminella
+1  A: 

I think "Display" would make sense if you were describing it in real-world terms.

Andy White
+3  A: 

You could implement it using a stack. A stack is last-in-first-out (LIFO), just like what you're describing with the display.

But if you're looking for something to name your calculation results, I'd agree with most of the answers that said "result" or "display". :-P

Chris Jester-Young
'buffer' from your comment looks like what I'm talking about. Can't pick a comment as the answer so I'll pick this answer. I guess it's pretty subjective based on the range of answers I got, though.
willc2