Talk:Topic variable

From Rosetta Code
Revision as of 17:26, 27 January 2013 by rosettacode>Markhobley (useful information)

Computing the cosine and rounding may be a relatively difficult task in some languages (esp. if the language does not have built in floating point handling), as opposed to setting the topic variable to a simple constant. If the task is just to demonstrate the use of the topic variable, then maybe simplify the task and remove the trigonometry and rounding requirements. I suggest leaving the task description simply as "Demonstrate the utilization and behaviour of the topic variable within the language",

Markhobley 13:01, 27 January 2013 (UTC)

Related issues are "what is a topic variable?" and "what is a shortcut?" --Rdm 14:11, 27 January 2013 (UTC)
If a language does not have standard trigonometric functions, custom versions can be provided, for instance with a Taylor series approximation or something. Same for rounding. For comparison purposes, I didn't want to be too liberal on how to show how topic variables can be used. Thus the three standard functions. It's a method that has been chosen for other tasks on RC, irrc.--Grondilu 15:37, 27 January 2013 (UTC)
Might it be changed to x, 2*x and x*x for example? --Paddy3118 16:14, 27 January 2013 (UTC)
There is also useful information that could be included such as how the topic variable behaves under different levels of scope that might be usefully to be shown here. This comes under utilization and behaviour. It does not come under trigonometric functions. The trigometry, could be made optional, eg: optionally show how to calculate a cosine, or maybe rename task Topic variable/Trigonometry, to show that the task is really about the topic variable in a trigonometric context, rather than generalized. Markhobley 17:26, 27 January 2013 (UTC)