File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -285,6 +285,10 @@ public fun Sink.writeULongLe(long: ULong) {
285285 *
286286 * Should be used with care when working with special values (like `NaN`) as bit patterns obtained for [Float.NaN] may vary depending on a platform.
287287 *
288+ * Note that in Kotlin/JS a value obtained by writing an original [Float] value to a [Sink] using
289+ * [Sink.writeFloat] and then reading it back using [Source.readFloat] may not be equal to the original value.
290+ * Please refer to [Float.toBits] documentation for details.
291+ *
288292 * @param float the floating point number to be written.
289293 *
290294 * @throws IllegalStateException when the sink is closed.
@@ -321,6 +325,10 @@ public fun Sink.writeDouble(double: Double) {
321325 *
322326 * Should be used with care when working with special values (like `NaN`) as bit patterns obtained for [Float.NaN] may vary depending on a platform.
323327 *
328+ * Note that in Kotlin/JS a value obtained by writing an original [Float] value to a [Sink] using
329+ * [Sink.writeFloatLe] and then reading it back using [Source.readFloatLe] may not be equal to the original value.
330+ * Please refer to [Float.toBits] documentation for details.
331+ *
324332 * @param float the floating point number to be written.
325333 *
326334 * @throws IllegalStateException when the sink is closed.
Original file line number Diff line number Diff line change @@ -361,6 +361,10 @@ public fun Source.readULongLe(): ULong = readLongLe().toULong()
361361 *
362362 * The [Float.Companion.fromBits] function is used for decoding bytes into [Float].
363363 *
364+ * Note that in Kotlin/JS a value obtained by writing an original [Float] value to a [Sink] using
365+ * [Sink.writeFloat] and then reading it back using [Source.readFloat] may not be equal to the original value.
366+ * Please refer to [Float.Companion.fromBits] documentation for details.
367+ *
364368 * @throws EOFException when there are not enough data to read an unsigned int value.
365369 * @throws IllegalStateException when the source is closed.
366370 *
@@ -387,6 +391,10 @@ public fun Source.readDouble(): Double = Double.fromBits(readLong())
387391 *
388392 * The [Float.Companion.fromBits] function is used for decoding bytes into [Float].
389393 *
394+ * Note that in Kotlin/JS a value obtained by writing an original [Float] value to a [Sink] using
395+ * [Sink.writeFloatLe] and then reading it back using [Source.readFloatLe] may not be equal to the original value.
396+ * Please refer to [Float.Companion.fromBits] documentation for details.
397+ *
390398 * @throws EOFException when there are not enough data to read an unsigned int value.
391399 * @throws IllegalStateException when the source is closed.
392400 *
You can’t perform that action at this time.
0 commit comments