From 0286fc81d9d7726cd878e9f67ec1c021b9f1e17b Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Mon, 21 Oct 2024 08:51:07 -0700 Subject: Minor README comment changes --- chapter16/README.md | 6 ++++-- chapter16/src/test/java/com/seaofnodes/simple/Chapter16Test.java | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/chapter16/README.md b/chapter16/README.md index 15125118..f78c8abc 100644 --- a/chapter16/README.md +++ b/chapter16/README.md @@ -52,8 +52,10 @@ declaration or the allocation. Any amount of code is legal, including ``` struct Square { flt side = arg; - flt diag = arg*arg/2; - // Newtons approximation to the square root, done in a constructor + flt diag = arg*arg/2; + // Newtons approximation to the square root, computed in a constructor. + // The actual allocation will copy in this result as the initial + // value for 'diag'. while( 1 ) { // The next-guess variable "next" is not a field in Square, // because it does not appear at the top level diff --git a/chapter16/src/test/java/com/seaofnodes/simple/Chapter16Test.java b/chapter16/src/test/java/com/seaofnodes/simple/Chapter16Test.java index c4f9795f..ad287e82 100644 --- a/chapter16/src/test/java/com/seaofnodes/simple/Chapter16Test.java +++ b/chapter16/src/test/java/com/seaofnodes/simple/Chapter16Test.java @@ -179,6 +179,9 @@ return next.i; """ struct Square { flt !side = arg; + // Newtons approximation to the square root, computed in a constructor. + // The actual allocation will copy in this result as the initial + // value for 'diag'. flt diag = arg*arg/2; while( 1 ) { flt next = (side/diag + diag)/2; -- cgit v1.2.3