From fc6b084fe9ac8fb8aa48406b8b49ab328d267957 Mon Sep 17 00:00:00 2001 From: Rex Jaeschke Date: Thu, 17 Aug 2023 13:11:53 -0400 Subject: [PATCH] Clarify the representation of Boolean value true (#898) * Add text about true's representation * Add new unspecified entry --- standard/portability-issues.md | 1 + standard/types.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/standard/portability-issues.md b/standard/portability-issues.md index 60a7afd7d..7e846a428 100644 --- a/standard/portability-issues.md +++ b/standard/portability-issues.md @@ -44,6 +44,7 @@ A conforming implementation is required to document its choice of behavior in ea ## B.4 Unspecified behavior 1. The time at which the finalizer (if any) for an object is run, once that object has become eligible for finalization ([§7.9](basic-concepts.md#79-automatic-memory-management)). +1. The representation of `true` ([§8.3.9](types.md#839-the-bool-type)). 1. The value of the result when converting out-of-range values from `float` or `double` values to an integral type in an `unchecked` context ([§10.3.2](conversions.md#1032-explicit-numeric-conversions)). 1. The exact target object and target method of the delegate produced from an *anonymous_method_expression* contains ([§10.7.2](conversions.md#1072-evaluation-of-anonymous-function-conversions-to-delegate-types)). 1. The layout of arrays, except in an unsafe context ([§12.8.16.5](expressions.md#128165-array-creation-expressions)). diff --git a/standard/types.md b/standard/types.md index bbea46f4e..686e3dda5 100644 --- a/standard/types.md +++ b/standard/types.md @@ -377,7 +377,7 @@ The `decimal` type has greater precision but may have a smaller range than the f ### 8.3.9 The Bool type -The `bool` type represents Boolean logical quantities. The possible values of type `bool` are `true` and `false`. +The `bool` type represents Boolean logical quantities. The possible values of type `bool` are `true` and `false`. The representation of `false` is described in [§8.3.3](types.md#833-default-constructors). Although the representation of `true` is unspecified, it shall be different from that of `false`. No standard conversions exist between `bool` and other value types. In particular, the `bool` type is distinct and separate from the integral types, a `bool` value cannot be used in place of an integral value, and vice versa.