@@ -2262,7 +2262,17 @@ public static CBORObject FromObject(byte value) {
2262
2262
}
2263
2263
2264
2264
/**
2265
- * Generates a CBOR object from a 32-bit floating-point number.
2265
+ * Generates a CBOR object from a 32-bit floating-point number. The input value
2266
+ * can be a not-a-number (NaN) value (such as <code>Float.NaN</code> in
2267
+ * DotNet or Float.NaN in Java); however, NaN values have multiple
2268
+ * forms that are equivalent for many applications' purposes, and
2269
+ * <code>Float.NaN</code> / <code>Float.NaN</code> is only one of these equivalent
2270
+ * forms. In fact, <code>CBORObject.FromObject(Float.NaN)</code> or
2271
+ * <code>CBORObject.FromObject(Float.NaN)</code> could produce a CBOR-encoded
2272
+ * object that differs between DotNet and Java, because
2273
+ * <code>Float.NaN</code> / <code>Float.NaN</code> may have a different form in
2274
+ * DotNet and Java (for example, the NaN value's sign may be negative
2275
+ * in DotNet, but positive in Java).
2266
2276
* @param value The parameter {@code value} is a 32-bit floating-point number.
2267
2277
* @return A CBOR object generated from the given number.
2268
2278
*/
@@ -2273,7 +2283,15 @@ public static CBORObject FromObject(float value) {
2273
2283
}
2274
2284
2275
2285
/**
2276
- * Generates a CBOR object from a 64-bit floating-point number.
2286
+ * Generates a CBOR object from a 64-bit floating-point number. The input value
2287
+ * can be a not-a-number (NaN) value (such as <code>Double.NaN</code>);
2288
+ * however, NaN values have multiple forms that are equivalent for many
2289
+ * applications' purposes, and <code>Double.NaN</code> is only one of these
2290
+ * equivalent forms. In fact, <code>CBORObject.FromObject(Double.NaN)</code>
2291
+ * could produce a CBOR-encoded object that differs between DotNet and
2292
+ * Java, because <code>Double.NaN</code> may have a different form in DotNet
2293
+ * and Java (for example, the NaN value's sign may be negative in
2294
+ * DotNet, but positive in Java).
2277
2295
* @param value The parameter {@code value} is a 64-bit floating-point number.
2278
2296
* @return A CBOR object generated from the given number.
2279
2297
*/
0 commit comments