Quiz1 MCS 320 Friday 26 August 2005
| > | restart; |
1. Explain how you can see that the command evalf belongs to the Maple kernel, while a command like evala is written in the language of Maple.
Answer:
After making more verbose, the print on the command will either show "builtin" for a command belonging to the kernel, or it will list the Maple code if the command is written in the language of Maple. The instructions below show that evalf belongs to the kernel, while we can see the Maple code for evala.
| > | interface(verboseproc=3); |
| > | print(evalf); |
| > | print(evala); |
2. What is the difference between e and e in Maple? (Hint: try to evaluate the transcendental number e to 30 decimal places.)
Show how you can "reserve" the letter e for the transcendental number e. Give all Maple commands which are relevant to your answer.
Answer:
The letter e is not reserved in Maple. To get to the transcendental number e, we can evaluate the exponential function exp(x) at x=1. Typing in exp(1) shows the bold letter e, we see the first 30 decimal places via eval(exp(1),30):
| > | e; |
| > | exp(1); |
| > | evalf(exp(1),30); |
To use the letter e as the transcendental number e, we use the alias command:
| > | alias(e=exp(1)); |
| > | evalf(e,50); |
| > |