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) {
285
285
*
286
286
* 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.
287
287
*
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
+ *
288
292
* @param float the floating point number to be written.
289
293
*
290
294
* @throws IllegalStateException when the sink is closed.
@@ -321,6 +325,10 @@ public fun Sink.writeDouble(double: Double) {
321
325
*
322
326
* 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.
323
327
*
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
+ *
324
332
* @param float the floating point number to be written.
325
333
*
326
334
* @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()
361
361
*
362
362
* The [Float.Companion.fromBits] function is used for decoding bytes into [Float].
363
363
*
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
+ *
364
368
* @throws EOFException when there are not enough data to read an unsigned int value.
365
369
* @throws IllegalStateException when the source is closed.
366
370
*
@@ -387,6 +391,10 @@ public fun Source.readDouble(): Double = Double.fromBits(readLong())
387
391
*
388
392
* The [Float.Companion.fromBits] function is used for decoding bytes into [Float].
389
393
*
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
+ *
390
398
* @throws EOFException when there are not enough data to read an unsigned int value.
391
399
* @throws IllegalStateException when the source is closed.
392
400
*
You can’t perform that action at this time.
0 commit comments