Download C* User`s Guide

Transcript
62
.,
:.·:::.·.,:::· :::
·· :·
· ·· ·· ·
.I
...
X::·::::i::·'''''·:'''
:::::: :::
:: :::: -,- ....: : " : .
· ··'··":'''''`'":I'::~::::·:iI~~l:i:,,,:
i.
·: ·· ; ·
:·
··:::;::::::::;··.::
.
·-:;*n
... ... ::r.
·· ·..
C* User Guide
~·;'·\' :::::..·· ::.·· -bii-_;. -
. ....
:: ·:
-
..
:
X.:~:~l~l~
The values have not changed from the previous execution of the program. We then look
at is_primep after line 38 is executed. As required, all values are now zero.
(dbx) n
stopped in find_primes at line 40 in file "primes.cs"
=
40 is candidate
(pcoord(O)
>= FIRST_PRIME)
? TRUE
: FALSE;
(dbx) ppr(is prime_p)
[./*Row*/]
0
1
2
3
4
5
6
7
8
9
0
0
0
0
0
0
0
0
0
0
stopped in find_primes at line 40 in file "primes.cs"
= (pcoord(O)
40 iscandidate
>= FIRST_PRIME)
? TRUE
: FALSE;
We continue go step throughthe program, looking at the behavior of isprimep:
(dbx) n
stopped in find_primes at line 43 in file "primes.cs"
43
(dbx) n
stopped
44
(dbx) n
stopped
45
(dbx) n
stopped
46
(dbx) n
stopped
47
{
where(iscandidate)
in find_primes at line 44 in file "primes.cs"
minimum_prime = <?= pcoord(0);
in find_primes at line 45 in file "primes.cs"
where(!(pcoord(0) % minimum_prime))
in find_primes at line 46 in file "primes.cs"
iscandidate = FALSE;
in find_primes at line 47 in file "primes.cs"
[minimum_prime] (*is_prime_p) = TRUE;
(dbx) n
stopped in find_primes at line 48 in file "primes.cs"
48
}
(dbx) ppr(isprime_p)
[./*Row*/]
0
1
2
3
4
5
6
7
8
9
0
0
1
0
0
0
0
0
0
0
0