@@ -2262,7 +2262,17 @@ public static CBORObject FromObject(byte value) {
22622262 }
22632263
22642264 /**
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).
22662276 * @param value The parameter {@code value} is a 32-bit floating-point number.
22672277 * @return A CBOR object generated from the given number.
22682278 */
@@ -2273,7 +2283,15 @@ public static CBORObject FromObject(float value) {
22732283 }
22742284
22752285 /**
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).
22772295 * @param value The parameter {@code value} is a 64-bit floating-point number.
22782296 * @return A CBOR object generated from the given number.
22792297 */
0 commit comments