Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions core/common/src/Sinks.kt
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,10 @@ public fun Sink.writeULongLe(long: ULong) {
*
* 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.
*
* Note that in Kotlin/JS a value obtained by writing an original [Float] value to a [Sink] using
* [Sink.writeFloat] and then reading it back using [Source.readFloat] may not be equal to the original value.
* Please refer to [Float.toBits] documentation for details.
*
* @param float the floating point number to be written.
*
* @throws IllegalStateException when the sink is closed.
Expand Down Expand Up @@ -321,6 +325,10 @@ public fun Sink.writeDouble(double: Double) {
*
* 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.
*
* Note that in Kotlin/JS a value obtained by writing an original [Float] value to a [Sink] using
* [Sink.writeFloatLe] and then reading it back using [Source.readFloatLe] may not be equal to the original value.
* Please refer to [Float.toBits] documentation for details.
*
* @param float the floating point number to be written.
*
* @throws IllegalStateException when the sink is closed.
Expand Down
8 changes: 8 additions & 0 deletions core/common/src/Sources.kt
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,10 @@ public fun Source.readULongLe(): ULong = readLongLe().toULong()
*
* The [Float.Companion.fromBits] function is used for decoding bytes into [Float].
*
* Note that in Kotlin/JS a value obtained by writing an original [Float] value to a [Sink] using
* [Sink.writeFloat] and then reading it back using [Source.readFloat] may not be equal to the original value.
* Please refer to [Float.Companion.fromBits] documentation for details.
*
* @throws EOFException when there are not enough data to read an unsigned int value.
* @throws IllegalStateException when the source is closed.
*
Expand All @@ -387,6 +391,10 @@ public fun Source.readDouble(): Double = Double.fromBits(readLong())
*
* The [Float.Companion.fromBits] function is used for decoding bytes into [Float].
*
* Note that in Kotlin/JS a value obtained by writing an original [Float] value to a [Sink] using
* [Sink.writeFloatLe] and then reading it back using [Source.readFloatLe] may not be equal to the original value.
* Please refer to [Float.Companion.fromBits] documentation for details.
*
* @throws EOFException when there are not enough data to read an unsigned int value.
* @throws IllegalStateException when the source is closed.
*
Expand Down