Skip to content

Commit 296cf82

Browse files
committed
Update comments.
1 parent 8230e3a commit 296cf82

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

libc/config/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
},
9191
"LIBC_CONF_FREXP_INF_NAN_EXPONENT": {
9292
"value": "",
93-
"doc": "Set the specific exp value for Inf/NaN inputs."
93+
"doc": "The value written back to the second parameter when calling frexp/frexpf/frexpl` with `+/-Inf`/`NaN` is unspecified. Configue an explicit exp value for Inf/NaN inputs."
9494
}
9595
},
9696
"qsort": {

libc/src/__support/FPUtil/ManipulationFunctions.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ LIBC_INLINE T frexp(T x, int &exp) {
3333
FPBits<T> bits(x);
3434
if (bits.is_inf_or_nan()) {
3535
#ifdef LIBC_FREXP_INF_NAN_EXPONENT
36+
// The value written back to the second parameter when calling
37+
// frexp/frexpf/frexpl` with `+/-Inf`/`NaN` is unspecified in the standard.
38+
// Set the exp value for Inf/NaN inputs explicitly to
39+
// LIBC_FREXP_INF_NAN_EXPONENT if it is defined.
3640
exp = LIBC_FREXP_INF_NAN_EXPONENT;
3741
#endif // LIBC_FREXP_INF_NAN_EXPONENT
3842
return x;

0 commit comments

Comments
 (0)