<div dir="ltr"><font face="monospace, monospace">As below. Apologies if I'm going about this review process incorrectly.</font><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">Kind regards,</font></div><div><font face="monospace, monospace">Adrian</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">--------------------</font></div><div><font face="monospace, monospace"><br></font></div><div><div><font face="monospace, monospace">Fix some comments in {int,uint}.m.</font></div><div><font face="monospace, monospace">    </font></div><div><font face="monospace, monospace">library/int8.m:</font></div><div><font face="monospace, monospace">library/int16.m:</font></div><div><font face="monospace, monospace">library/int64.m:</font></div><div><font face="monospace, monospace">library/uint8.m:</font></div><div><font face="monospace, monospace">library/uint16.m:</font></div><div><font face="monospace, monospace">library/uint32.m:</font></div><div><font face="monospace, monospace">library/uint64.m:</font></div><div><font face="monospace, monospace">    As above.</font></div></div><div><br></div><div><font face="monospace, monospace"><div>diff --git a/library/int16.m b/library/int16.m</div><div>index a40b82cf1..fdd54d51c 100644</div><div>--- a/library/int16.m</div><div>+++ b/library/int16.m</div><div>@@ -30,7 +30,7 @@</div><div>     %</div><div> :- pred from_int(int::in, int16::out) is semidet.</div><div> </div><div>-    % det_from_int(I, I16):</div><div>+    % det_from_int(I) = I16:</div><div>     %</div><div>     % Convert an int to an int16.</div><div>     % Throws an exception if I is not in [-(2^15), 2^15 - 1].</div><div>diff --git a/library/int64.m b/library/int64.m</div><div>index 28d1eaba5..e894bea73 100644</div><div>--- a/library/int64.m</div><div>+++ b/library/int64.m</div><div>@@ -53,9 +53,11 @@</div><div> </div><div>     % cast_to_int(I64) = I:</div><div>     %</div><div>-    % Convert an int64 to an int. Since an int can be only 32 or 64 bits,</div><div>-    % this is guaranteed to yield a result that is mathematically equal</div><div>-    % to the original.</div><div>+    % Convert an int64 to an int.</div><div>+    % Always succeeds. If ints are 64 bits, I will always be</div><div>+    % mathematically equal to I64. However, if ints are 32 bits,</div><div>+    % then I will be mathematically equal to I64 only if</div><div>+    % I64 is in [-(2^31), 2^31 - 1].</div><div>     %</div><div> :- func cast_to_int(int64) = int.</div><div> </div><div>diff --git a/library/int8.m b/library/int8.m</div><div>index 46f06af85..9c3769469 100644</div><div>--- a/library/int8.m</div><div>+++ b/library/int8.m</div><div>@@ -30,7 +30,7 @@</div><div>     %</div><div> :- pred from_int(int::in, int8::out) is semidet.</div><div> </div><div>-    % from_int(I, I8):</div><div>+    % det_from_int(I) = I8:</div><div>     %</div><div>     % Convert an int to an int8.</div><div>     % Throws an exception if I is not in [-(2^7), 2^7 - 1].</div><div>diff --git a/library/uint16.m b/library/uint16.m</div><div>index 63f24c736..f179e32ae 100644</div><div>--- a/library/uint16.m</div><div>+++ b/library/uint16.m</div><div>@@ -26,14 +26,14 @@</div><div>     % from_int(I, U16):</div><div>     %</div><div>     % Convert an int into a uint16.</div><div>-    % Fails if I is not in [0, 2^15 - 1].</div><div>+    % Fails if I is not in [0, 2^16 - 1].</div><div>     %</div><div> :- pred from_int(int::in, uint16::out) is semidet.</div><div> </div><div>-    % from_int(I, U16):</div><div>+    % det_from_int(I) = U16:</div><div>     %</div><div>     % Convert an int into a uint16.</div><div>-    % Throws an exception if I is not in [0, 2^15 - 1].</div><div>+    % Throws an exception if I is not in [0, 2^16 - 1].</div><div>     %</div><div> :- func det_from_int(int) = uint16.</div><div> </div><div>@@ -41,7 +41,7 @@</div><div>     %</div><div>     % Convert an int to a uint16.</div><div>     % Always succeeds, but will yield a result that is mathematically equal</div><div>-    % to I only if I is in [0, 2^15 - 1].</div><div>+    % to I only if I is in [0, 2^16 - 1].</div><div>     %</div><div> :- func cast_from_int(int) = uint16.</div><div> </div><div>@@ -87,7 +87,7 @@</div><div>     % cast_from_int16(I16) = U16:</div><div>     %</div><div>     % Convert an int16 to a uint16. This will yield a result that is</div><div>-    % mathematically equal to I16 only if I16 is in [0, 2^15 -1].</div><div>+    % mathematically equal to I16 only if I16 is in [0, 2^15 - 1].</div><div>     %</div><div> :- func cast_from_int16(int16) = uint16.</div><div> </div><div>diff --git a/library/uint32.m b/library/uint32.m</div><div>index 4ebb2dcdc..c711cba31 100644</div><div>--- a/library/uint32.m</div><div>+++ b/library/uint32.m</div><div>@@ -26,14 +26,14 @@</div><div>     % from_int(I, U32):</div><div>     %</div><div>     % Convert an int into a uint32.</div><div>-    % Fails if I is not in [0, 2^31 - 1].</div><div>+    % Fails if I is not in [0, 2^32 - 1].</div><div>     %</div><div> :- pred from_int(int::in, uint32::out) is semidet.</div><div> </div><div>-    % from_int(I, U32):</div><div>+    % det_from_int(I) = U32:</div><div>     %</div><div>     % Convert an int into a uint32.</div><div>-    % Throws an exception if I is not in [0, 2^31 - 1].</div><div>+    % Throws an exception if I is not in [0, 2^32 - 1].</div><div>     %</div><div> :- func det_from_int(int) = uint32.</div><div> </div><div>@@ -41,7 +41,7 @@</div><div>     %</div><div>     % Convert an int to a uint32.</div><div>     % Always succeeds, but will yield a result that is mathematically equal</div><div>-    % to I only if I is in [0, 2^31 - 1].</div><div>+    % to I only if I is in [0, 2^32 - 1].</div><div>     %</div><div> :- func cast_from_int(int) = uint32.</div><div> </div><div>@@ -81,7 +81,7 @@</div><div>     % cast_from_int32(I32) = U32:</div><div>     %</div><div>     % Convert an int32 to a uint32. This will yield a result that is</div><div>-    % mathematically equal to I32 only if I32 is in [0, 2^31 -1].</div><div>+    % mathematically equal to I32 only if I32 is in [0, 2^31 - 1].</div><div>     %</div><div> :- func cast_from_int32(int32) = uint32.</div><div> </div><div>diff --git a/library/uint64.m b/library/uint64.m</div><div>index c91d4703d..450dbac65 100644</div><div>--- a/library/uint64.m</div><div>+++ b/library/uint64.m</div><div>@@ -26,14 +26,14 @@</div><div>     % from_int(I, U64):</div><div>     %</div><div>     % Convert an int into a uint64.</div><div>-    % Fails if I is not in [0, 2^63 - 1].</div><div>+    % Fails if I is not in [0, 2^64 - 1].</div><div>     %</div><div> :- pred from_int(int::in, uint64::out) is semidet.</div><div> </div><div>-    % det_from_int(I, U64):</div><div>+    % det_from_int(I) = U64:</div><div>     %</div><div>     % Convert an int into a uint64.</div><div>-    % Throws an exception if I is not in [0, 2^63 - 1].</div><div>+    % Throws an exception if I is not in [0, 2^64 - 1].</div><div>     %</div><div> :- func det_from_int(int) = uint64.</div><div> </div><div>@@ -41,7 +41,7 @@</div><div>     %</div><div>     % Convert an int to a uint64.</div><div>     % Always succeeds, but will yield a result that is mathematically equal</div><div>-    % to I only if I is in [0, 2^63 - 1].</div><div>+    % to I only if I is in [0, 2^64 - 1].</div><div>     %</div><div> :- func cast_from_int(int) = uint64.</div><div> </div><div>@@ -53,8 +53,10 @@</div><div>     % cast_to_int(U64) = I:</div><div>     %</div><div>     % Convert a uint64 to an int.</div><div>-    % Always succeeds, but will yield a result that is mathematically equal</div><div>-    % to U64 only if U64 is in [0, 2^63 - 1].</div><div>+    % Always succeeds. If ints are 64 bits, I will be mathematically</div><div>+    % equal to U64 only if U64 is in [0, 2^63 - 1]. If ints are 32</div><div>+    % bits, I will be mathematically equal to U64 only if U64 is in</div><div>+    % [0, 2^31 - 1].</div><div>     %</div><div> :- func cast_to_int(uint64) = int.</div><div> </div><div>@@ -79,7 +81,7 @@</div><div>     % cast_from_int64(I64) = U64:</div><div>     %</div><div>     % Convert an int64 to a uint64. This will yield a result that is</div><div>-    % mathematically equal to I64 only if I64 is in [0, 2^63 -1].</div><div>+    % mathematically equal to I64 only if I64 is in [0, 2^63 - 1].</div><div>     %</div><div> :- func cast_from_int64(int64) = uint64.</div><div> </div><div>diff --git a/library/uint8.m b/library/uint8.m</div><div>index 1c8701f99..16e6da2d7 100644</div><div>--- a/library/uint8.m</div><div>+++ b/library/uint8.m</div><div>@@ -26,14 +26,14 @@</div><div>     % from_int(I, U8):</div><div>     %</div><div>     % Convert an int to a uint8.</div><div>-    % Fails if I is not in [0, 2^7 - 1].</div><div>+    % Fails if I is not in [0, 2^8 - 1].</div><div>     %</div><div> :- pred from_int(int::in, uint8::out) is semidet.</div><div> </div><div>-    % from_int(I, U8):</div><div>+    % det_from_int(I) = U8:</div><div>     %</div><div>     % Convert an int to a uint8.</div><div>-    % Throws an exception if I is not in [0, 2^7 - 1].</div><div>+    % Throws an exception if I is not in [0, 2^8 - 1].</div><div>     %</div><div> :- func det_from_int(int) = uint8.</div><div> </div><div>@@ -41,7 +41,7 @@</div><div>     %</div><div>     % Convert an int to a uint8.</div><div>     % Always succeeds, but will yield a result that is mathematically equal</div><div>-    % to I only if I is in [0, 2^7 - 1].</div><div>+    % to I only if I is in [0, 2^8 - 1].</div><div>     %</div><div> :- func cast_from_int(int) = uint8.</div><div> </div><div>@@ -87,7 +87,7 @@</div><div>     % cast_from_int8(I8) = U8:</div><div>     %</div><div>     % Convert an int8 to a uint8. This will yield a result that is</div><div>-    % mathematically equal to I8 only if I8 is in [0, 2^7 -1].</div><div>+    % mathematically equal to I8 only if I8 is in [0, 2^7 - 1].</div><div>     %</div><div> :- func cast_from_int8(int8) = uint8.</div><div> </div><div><br></div></font></div></div>