Skip to content

Commit d7f8c8a

Browse files
committed
em-dashes to hyphen-minus
This fixes an old bulk change.
1 parent fd15588 commit d7f8c8a

1 file changed

Lines changed: 19 additions & 19 deletions

File tree

standard/expressions.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3612,9 +3612,9 @@ For an operation of the form `-x`, unary operator overload resolution ([§12.4.
36123612
- Integer negation:
36133613

36143614
```csharp
3615-
int operator (int x);
3616-
nint operator (nint x);
3617-
long operator (long x);
3615+
int operator -(int x);
3616+
nint operator -(nint x);
3617+
long operator -(long x);
36183618
```
36193619

36203620
The result is computed by subtracting `X` from zero. If the value of `X` is the smallest representable value of the operand type (−2³¹ for `int`, the corresponding value for `nint`, or −2⁶³ for `long`), then the mathematical negation of `X` is not representable within the operand type. If this occurs within a `checked` context, a `System.OverflowException` is thrown; if it occurs within an `unchecked` context, the result is the value of the operand and the overflow is not reported.
@@ -3627,15 +3627,15 @@ For an operation of the form `-x`, unary operator overload resolution ([§12.4.
36273627
- Floating-point negation:
36283628

36293629
```csharp
3630-
float operator (float x);
3631-
double operator (double x);
3630+
float operator -(float x);
3631+
double operator -(double x);
36323632
```
36333633

36343634
The result is the value of `X` with its sign inverted. If `x` is `NaN`, the result is also `NaN`.
36353635
- Decimal negation:
36363636

36373637
```csharp
3638-
decimal operator (decimal x);
3638+
decimal operator -(decimal x);
36393639
```
36403640

36413641
The result is computed by subtracting `X` from zero. Decimal negation is equivalent to using the unary minus operator of type `System.Decimal`.
@@ -4229,20 +4229,20 @@ The predefined subtraction operators are listed below. The operators all subtrac
42294229
- Integer subtraction:
42304230

42314231
```csharp
4232-
int operator (int x, int y);
4233-
uint operator (uint x, uint y);
4234-
nint operator (nint x, nint y);
4235-
nuint operator (nuint x, nuint y);
4236-
long operator (long x, long y);
4237-
ulong operator (ulong x, ulong y);
4232+
int operator -(int x, int y);
4233+
uint operator -(uint x, uint y);
4234+
nint operator -(nint x, nint y);
4235+
nuint operator -(nuint x, nuint y);
4236+
long operator -(long x, long y);
4237+
ulong operator -(ulong x, ulong y);
42384238
```
42394239

42404240
In a `checked` context, if the difference is outside the range of the result type, a `System.OverflowException` is thrown. In an `unchecked` context, overflows are not reported and any significant high-order bits outside the range of the result type are discarded.
42414241
- Floating-point subtraction:
42424242

42434243
```csharp
4244-
float operator (float x, float y);
4245-
double operator (double x, double y);
4244+
float operator -(float x, float y);
4245+
double operator -(double x, double y);
42464246
```
42474247

42484248
The difference is computed according to the rules of IEC 60559 arithmetic. The following table lists the results of all possible combinations of nonzero finite values, zeros, infinities, and NaNs. In the table, `x` and `y` are nonzero finite values, and `z` is the result of `x – y`. If `x` and `y` are equal, `z` is positive zero. If `x – y` is too large to represent in the destination type, `z` is an infinity with the same sign as `x – y`.
@@ -4260,7 +4260,7 @@ The predefined subtraction operators are listed below. The operators all subtrac
42604260
- Decimal subtraction:
42614261

42624262
```csharp
4263-
decimal operator (decimal x, decimal y);
4263+
decimal operator -(decimal x, decimal y);
42644264
```
42654265

42664266
If the magnitude of the resulting value is too large to represent in the decimal format, a `System.OverflowException` is thrown. The scale of the result, before any rounding, is the larger of the scales of the two operands.
@@ -4270,21 +4270,21 @@ The predefined subtraction operators are listed below. The operators all subtrac
42704270
- Enumeration subtraction. Every enumeration type implicitly provides the following predefined operator, where `E` is the enum type, and `U` is the underlying type of `E`:
42714271

42724272
```csharp
4273-
U operator (E x, E y);
4273+
U operator -(E x, E y);
42744274
```
42754275

42764276
This operator is evaluated exactly as `(U)((U)x – (U)y)`. In other words, the operator computes the difference between the ordinal values of `x` and `y`, and the type of the result is the underlying type of the enumeration.
42774277

42784278
```csharp
4279-
E operator (E x, U y);
4279+
E operator -(E x, U y);
42804280
```
42814281

42824282
This operator is evaluated exactly as `(E)((U)x – y)`. In other words, the operator subtracts a value from the underlying type of the enumeration, yielding a value of the enumeration.
42834283

42844284
- Delegate removal. Every delegate type implicitly provides the following predefined operator, where `D` is the delegate type:
42854285

42864286
```csharp
4287-
D operator (D x, D y);
4287+
D operator -(D x, D y);
42884288
```
42894289

42904290
The semantics are as follows:
@@ -4540,7 +4540,7 @@ If either operand is NaN, the result is `false` for all operators except `!=`,
45404540
When neither operand is NaN, the operators compare the values of the two floating-point operands with respect to the ordering
45414541

45424542
```csharp
4543-
< max < ... < min < 0.0 == +0.0 < +min < ... < +max < +
4543+
-< -max < ... < -min < -0.0 == +0.0 < +min < ... < +max < +
45444544
```
45454545

45464546
where `min` and `max` are the smallest and largest positive finite values that can be represented in the given floating-point format. Notable effects of this ordering are:

0 commit comments

Comments
 (0)