Skip to content

Commit 8b64997

Browse files
author
Colin Robertson
committed
Fix #INF issues
1 parent 1633aa4 commit 8b64997

10 files changed

Lines changed: 48 additions & 76 deletions

docs/c-runtime-library/cicos.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void __cdecl _CIcos();
2828

2929
## Remarks
3030

31-
This version of the [cos]() function has a specialized calling convention that the compiler understands. It speeds up the execution because it prevents copies from being generated and helps with register allocation.
31+
This version of the [cos](../c-runtime-library/reference/cos-cosf-cosl.md) function has a specialized calling convention that the compiler understands. It speeds up the execution because it prevents copies from being generated and helps with register allocation.
3232

3333
The resulting value is pushed onto the top of the floating-point stack.
3434

@@ -38,5 +38,5 @@ The resulting value is pushed onto the top of the floating-point stack.
3838

3939
## See also
4040

41-
[Alphabetical Function Reference](../c-runtime-library/reference/crt-alphabetical-function-reference.md)
42-
[cos, cosf, cosl](../c-runtime-library/reference/cos-cosf-cosl.md)
41+
[Alphabetical Function Reference](../c-runtime-library/reference/crt-alphabetical-function-reference.md)<br/>
42+
[cos, cosf, cosl](../c-runtime-library/reference/cos-cosf-cosl.md)<br/>

docs/c-runtime-library/file-handling.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ ms.workload: ["cplusplus"]
2121

2222
Use these routines to create, delete, and manipulate files and to set and check file-access permissions.
2323

24-
The C run-time libraries have a 512 limit for the number of files that can be open at any one time. Attempting to open more than the maximum number of file descriptors or file streams causes program failure. Use [_setmaxstdio](../c-runtime-library/reference/setmaxstdio.md) to change this number.
24+
The C run-time libraries have a 512 limit for the number of files that can be open at any one time. Attempting to open more than the maximum number of file descriptors or file streams causes program failure. Use [_setmaxstdio](../c-runtime-library/reference/setmaxstdio.md) to change this number.
2525

2626
## File-Handling Routines (File Descriptor)
2727

28-
These routines operate on files designated by a file descriptor.
28+
These routines operate on files designated by a file descriptor.
2929

3030
|Routine|Use|
3131
|-------------|---------|
@@ -40,7 +40,7 @@ Use these routines to create, delete, and manipulate files and to set and check
4040

4141
## File-Handling Routines (Path or Filename)
4242

43-
These routines operate on files specified by a path or filename.
43+
These routines operate on files specified by a path or filename.
4444

4545
|Routine|Use|
4646
|-------------|---------|
@@ -58,7 +58,7 @@ Use these routines to create, delete, and manipulate files and to set and check
5858

5959
## File-Handling Routines (Open File)
6060

61-
These routines open files.
61+
These routines open files.
6262

6363
|Routine|Use|
6464
|-------------|---------|
@@ -69,7 +69,7 @@ Use these routines to create, delete, and manipulate files and to set and check
6969
|[_pipe](../c-runtime-library/reference/pipe.md)|Creates a pipe for reading and writing.|
7070
|[freopen, _wfreopen](../c-runtime-library/reference/freopen-wfreopen.md), [freopen_s, _wfreopen_s](../c-runtime-library/reference/freopen-s-wfreopen-s.md)|Reassign a file pointer.|
7171

72-
These routines provide a way to change the representation of the file between a `FILE` structure, a file descriptor, and a Win32 file handle.
72+
These routines provide a way to change the representation of the file between a `FILE` structure, a file descriptor, and a Win32 file handle.
7373

7474
|Routine|Use|
7575
|-------------|---------|
@@ -80,14 +80,14 @@ Use these routines to create, delete, and manipulate files and to set and check
8080

8181
The following Win32 functions also open files and pipes:
8282

83-
- [CreateFile](http://msdn.microsoft.com/library/windows/desktop/aa363858.aspx)
83+
- [CreateFile](http://msdn.microsoft.com/library/windows/desktop/aa363858.aspx)
8484

85-
- [CreatePipe](http://msdn.microsoft.com/library/windows/desktop/aa365152.aspx)
85+
- [CreatePipe](http://msdn.microsoft.com/library/windows/desktop/aa365152.aspx)
8686

87-
- [CreateNamedPipe](http://msdn.microsoft.com/library/windows/desktop/aa365150.aspx)
87+
- [CreateNamedPipe](http://msdn.microsoft.com/library/windows/desktop/aa365150.aspx)
8888

8989
## See Also
9090

9191
[Universal C runtime routines by category](../c-runtime-library/run-time-routines-by-category.md)<br/>
92-
[Directory Control](../c-runtime-library/directory-control.md)<br/>
93-
[System Calls](../c-runtime-library/system-calls.md)<br/>
92+
[Directory Control](../c-runtime-library/directory-control.md)<br/>
93+
[System Calls](../c-runtime-library/system-calls.md)<br/>

docs/c-runtime-library/reference/abs-labs-llabs-abs64.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,7 @@ The **abs**, **labs**, **llabs** and **_abs64** functions return the absolute va
5454

5555
Because C++ allows overloading, you can call overloads of **abs** that take and return **long**, **long** **long**, **float**, **double**, and **long** **double** values. These overloads are defined in the \<cmath> header. In a C program, **abs** always takes and returns an int.
5656

57-
**Microsoft Specific**
58-
59-
Because the range of negative integers that can be represented by using any integral type is larger than the range of positive integers that can be represented by using that type, it's possible to supply an argument to these functions that can’t be converted. If the absolute value of the argument cannot be represented by the return type, the **abs** functions return the argument value unchanged. Specifically, `abs(INT_MIN)` returns **INT_MIN**, `labs(LONG_MIN)` returns **LONG_MIN**, `llabs(LLONG_MIN)` returns **LLONG_MIN**, and `_abs64(_I64_MIN)` returns **_I64_MIN**. This means that the **abs** functions cannot be used to guarantee a positive value.
60-
61-
**End Microsoft Specific**
57+
**Microsoft Specific**: Because the range of negative integers that can be represented by using any integral type is larger than the range of positive integers that can be represented by using that type, it's possible to supply an argument to these functions that can’t be converted. If the absolute value of the argument cannot be represented by the return type, the **abs** functions return the argument value unchanged. Specifically, `abs(INT_MIN)` returns **INT_MIN**, `labs(LONG_MIN)` returns **LONG_MIN**, `llabs(LLONG_MIN)` returns **LLONG_MIN**, and `_abs64(_I64_MIN)` returns **_I64_MIN**. This means that the **abs** functions cannot be used to guarantee a positive value.
6258

6359
## Requirements
6460

@@ -67,7 +63,7 @@ Because the range of negative integers that can be represented by using any inte
6763
|**abs**, **labs**, **llabs**|\<math.h> or \<stdlib.h>|\<cmath>, \<cstdlib>, \<stdlib.h> or \<math.h>|
6864
|**_abs64**|\<stdlib.h>|\<cstdlib> or \<stdlib.h>|
6965

70-
To use the overloaded versions of **abs** in C++, you must include the \<cmath> header.
66+
To use the overloaded versions of **abs** in C++, you must include the \<cmath> header.
7167

7268
## Example
7369

@@ -124,7 +120,6 @@ Microsoft implementation-specific results:
124120
labs(LONG_MIN) returns -2147483648
125121
llabs(LLONG_MIN) returns -9223372036854775808
126122
_abs64(_I64_MIN) returns 0x8000000000000000
127-
128123
```
129124

130125
## See Also
@@ -134,4 +129,3 @@ Microsoft implementation-specific results:
134129
[_cabs](../../c-runtime-library/reference/cabs.md)<br/>
135130
[fabs, fabsf, fabsl](../../c-runtime-library/reference/fabs-fabsf-fabsl.md)<br/>
136131
[imaxabs](../../c-runtime-library/reference/imaxabs.md)<br/>
137-

docs/c-runtime-library/reference/atodbl-atodbl-l-atoldbl-atoldbl-l-atoflt-atoflt-l.md

Lines changed: 20 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -26,58 +26,37 @@ Converts a string to a double (**_atodbl**), long double (**_atoldbl**), or floa
2626

2727
## Syntax
2828

29-
```
30-
int _atodbl(
31-
_CRT_DOUBLE * value,
32-
char * str
33-
);
34-
int _atodbl_l (
35-
_CRT_DOUBLE * value,
36-
char * str,
37-
locale_t locale
38-
);
39-
int _atoldbl(
40-
_LDOUBLE * value,
41-
char * str
42-
);
43-
int _atoldbl_l (
44-
_LDOUBLE * value,
45-
char * str,
46-
locale_t locale
47-
);
48-
int _atoflt(
49-
_CRT_FLOAT * value,
50-
const char * str
51-
);
52-
int _atoflt_l(
53-
_CRT_FLOAT * value,
54-
const char * str,
55-
locale_t locale
56-
);
29+
```C
30+
int _atodbl( _CRT_DOUBLE * value, char * str );
31+
int _atodbl_l ( _CRT_DOUBLE * value, char * str, locale_t locale );
32+
int _atoldbl( _LDOUBLE * value, char * str );
33+
int _atoldbl_l ( _LDOUBLE * value, char * str, locale_t locale );
34+
int _atoflt( _CRT_FLOAT * value, const char * str );
35+
int _atoflt_l( _CRT_FLOAT * value, const char * str, locale_t locale );
5736
```
5837
59-
#### Parameters
38+
### Parameters
6039
6140
*value*<br/>
62-
The double, long double, or float value that's produced by converting the string to a floating-point value. These values are wrapped in a structure.
41+
The double, long double, or float value that's produced by converting the string to a floating-point value. These values are wrapped in a structure.
6342
64-
*str*<br/>
65-
The string to be parsed to convert into a floating-point value.
43+
*str*<br/>
44+
The string to be parsed to convert into a floating-point value.
6645
67-
*locale*<br/>
68-
The locale to use.
46+
*locale*<br/>
47+
The locale to use.
6948
7049
## Return Value
7150
72-
Returns 0 if successful. Possible error codes are **_UNDERFLOW** or **_OVERFLOW**, which are defined in the header file Math.h.
51+
Returns 0 if successful. Possible error codes are **_UNDERFLOW** or **_OVERFLOW**, which are defined in the header file \<math.h>.
7352
7453
## Remarks
7554
7655
These functions convert a string to a floating-point value. The difference between these functions and the **atof** family of functions is that these functions do not generate floating-point code and do not cause hardware exceptions. Instead, error conditions are reported as error codes.
7756
78-
If a string does not have a valid interpretation as a floating-point value, *value* is set to zero and the return value is zero.
57+
If a string does not have a valid interpretation as a floating-point value, *value* is set to zero and the return value is zero.
7958
80-
The versions of these functions that have the **_l** suffix are identical the versions that don't have the suffix, except that they use the *locale* parameter that's passed in instead of the current thread locale.
59+
The versions of these functions that have the **_l** suffix are identical the versions that don't have the suffix, except that they use the *locale* parameter that's passed in instead of the current thread locale.
8160
8261
## Requirements
8362
@@ -137,13 +116,13 @@ Return value: 0
137116
Float value: 0.000000
138117
Return value: 0
139118
140-
Float value: 1.#INF00
119+
Float value: inf
141120
Return value: 3
142121
```
143122

144123
## See Also
145124

146125
[Data Conversion](../../c-runtime-library/data-conversion.md)<br/>
147-
[Floating-Point Support](../../c-runtime-library/floating-point-support.md)<br/>
148-
[Locale](../../c-runtime-library/locale.md)<br/>
149-
[atof, _atof_l, _wtof, _wtof_l](../../c-runtime-library/reference/atof-atof-l-wtof-wtof-l.md)<br/>
126+
[Floating-Point Support](../../c-runtime-library/floating-point-support.md)<br/>
127+
[Locale](../../c-runtime-library/locale.md)<br/>
128+
[atof, _atof_l, _wtof, _wtof_l](../../c-runtime-library/reference/atof-atof-l-wtof-wtof-l.md)<br/>

docs/c-runtime-library/reference/matherr.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ int _matherr( struct _exception *except )
139139
140140
```Output
141141
Special: using absolute value: log: _DOMAIN error
142-
log( -2.0 ) = 6.931472e-001
142+
log( -2.0 ) = 6.931472e-01
143143
Special: using absolute value: log10: _DOMAIN error
144-
log10( -5.0 ) = 6.989700e-001
145-
Normal: log( 0.0 ) = -1.#INF00e+000
144+
log10( -5.0 ) = 6.989700e-01
145+
Normal: log( 0.0 ) = -inf
146146
```
147147

148148
## See also

docs/cpp/standard-conversions.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ int main()
109109

110110
Objects of unsigned integral types can be converted to corresponding signed types. However, such a conversion can cause misinterpretation of data if the value of the unsigned object is outside the range representable by the signed type, as demonstrated in the following example:
111111

112-
```
113-
112+
```cpp
114113
#include <iostream>
115114

116115
using namespace std;
@@ -131,11 +130,11 @@ int main()
131130

132131
An object of a floating type can also be converted to a less precise type, if it is in a range representable by that type. (See [Floating Limits](../cpp/floating-limits.md) for the ranges of floating types.) If the original value cannot be represented precisely, it can be converted to either the next higher or the next lower representable value. If no such value exists, the result is undefined. Consider the following example:
133132

134-
```
133+
```cpp
135134
cout << (float)1E300 << endl;
136135
```
137136

138-
The maximum value representable by type **float** is 3.402823466E38 — a much smaller number than 1E300. Therefore, the number is converted to infinity, and the result is 1.#INF.
137+
The maximum value representable by type **float** is 3.402823466E38 — a much smaller number than 1E300. Therefore, the number is converted to infinity, and the result is "inf".
139138

140139
## Conversions between integral and floating point types
141140
Certain expressions can cause objects of floating type to be converted to integral types, or vice versa. When an object of integral type is converted to a floating type and the original value cannot be represented exactly, the result is either the next higher or the next lower representable value.

docs/standard-library/numeric-limits-class.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,9 +527,9 @@ int main( )
527527
1
528528
0
529529
0
530-
The representation of infinity for type float is: 1.#INF
531-
The representation of infinity for type double is: 1.#INF
532-
The representation of infinity for type long double is: 1.#INF
530+
The representation of infinity for type float is: inf
531+
The representation of infinity for type double is: inf
532+
The representation of infinity for type long double is: inf
533533
```
534534

535535
## <a name="is_bounded"></a> numeric_limits::is_bounded

docs/standard-library/valarray-class.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ int main( )
10031003
The initial valarray is: ( 100 -100 100 -100 100 -100 ).
10041004
The initial Right valarray is: ( 0 2 4 6 8 10 ).
10051005
The element-by-element result of the quotient is the
1006-
valarray: ( 1.#INF -50 25 -16.6667 12.5 -10 ).
1006+
valarray: ( inf -50 25 -16.6667 12.5 -10 ).
10071007
*\
10081008
```
10091009

docs/standard-library/valarray-functions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ int main( )
636636
```Output
637637
Initial valarray: 0 10 20 30 40 50 60 70 80
638638
The natural logarithm of the initial valarray is:
639-
-1.#INF
639+
-inf
640640
2.30259
641641
2.99573
642642
3.4012
@@ -696,7 +696,7 @@ int main( )
696696
```Output
697697
Initial valarray: 0 10 20 30 40 50 60 70 80 90 100
698698
The common logarithm of the initial valarray is:
699-
-1.#INF
699+
-inf
700700
1
701701
1.30103
702702
1.47712

docs/standard-library/valarray-operators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,7 @@ int main( )
12021202
The initial Left valarray is: ( 100 -100 100 -100 100 -100 ).
12031203
The initial Right valarray is: ( 0 2 4 6 8 10 ).
12041204
The element-by-element result of the quotient is the
1205-
valarray: ( 1.#INF -50 25 -16.6667 12.5 -10 ).
1205+
valarray: ( inf -50 25 -16.6667 12.5 -10 ).
12061206
*\
12071207
```
12081208

0 commit comments

Comments
 (0)