From 319ba5f61f894f6ff17456ea8c8ed43dabbf16b1 Mon Sep 17 00:00:00 2001 From: "harrisonj2@berea.edu" Date: Tue, 21 Jul 2026 09:23:52 -0500 Subject: [PATCH] Changed listing 1 to be a refrence from a hard code --- pretext/Functions/DefiningFunctions.ptx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pretext/Functions/DefiningFunctions.ptx b/pretext/Functions/DefiningFunctions.ptx index 55d66e0..ffde462 100644 --- a/pretext/Functions/DefiningFunctions.ptx +++ b/pretext/Functions/DefiningFunctions.ptx @@ -78,16 +78,15 @@ int main() { takes a value n and repeatedly guesses the square root by making each newguess the oldguess in the subsequent iteration. The initial guess used here is \frac {n}{2}. - Listing 1 shows a function definition that accepts a value + shows a function definition that accepts a value n and returns the square root of n after making 20 guesses. Again, the details of Newton's Method are hidden inside the function definition and the user does not have to know anything about the implementation to use the function for its intended purpose. - Listing 1 also shows the use of the // characters as a comment + also shows the use of the // characters as a comment marker. Any characters that follow the // on a line are ignored.

- -

Listing 1 - + +

// returns the square root of a number as a double @@ -113,7 +112,7 @@ int main() { } -

+