Template:ROOT/Exercise
This is a template designed for the book ROOT. It should be used to embed exercises into other pages.
Usage
editSyntax
edit{{ROOT/Exercise|#1}}
Parameter | Default Value | Mandatory | Description |
---|---|---|---|
#1 | various | yes | Name of the exercise to embed. |
Further Explanation
edit- If necessary: Create a new page for the exercise and name it
Template:ROOT/Exercises/A new ROOT Exercise
. Put<onlyinclude></onlyinclude>
tags around the question. - Go to the page you want to embed the exercise and add
{{ROOT/Exercise|A new ROOT Exercise}}
. Note that theTemplate:ROOT/Exercises/
in the exercise's name is omitted! - Also embed the exercise on the page ROOT/Exercises.
Example
editIn this example, we embed the exercise Trying Interactive ROOT which is located at the page named Template:ROOT/Exercises/Trying Interactive ROOT
.
Code
edit{{ROOT/Exercise|Trying Interactive ROOT}}
Result
editExercise: Trying Interactive ROOT |
---|
On an interactive ROOT session: Fill an array of 100 000 000 64Bit floating point numbers of the machine independent ROOT type Double_t with random numbers. Compute the mean of the array and print it to the console. Note the computation time.
Hint: You can get random real numbers by creating a pointer to an instance of the TRandom *R = new TRandom(time(0)); // create a pointer to a new instance of TRandom in the heap
cout << R->Rndm() << endl;
|
[Solution] |