mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-13 15:34:42 +00:00
Fixes encoding 0.0 as q_double (#33)
This commit is contained in:
parent
9d76d08948
commit
c03b29b2bd
1 changed files with 1 additions and 4 deletions
|
|
@ -37,10 +37,7 @@ final class QuantizedDoubleCodec(min: Double, max: Double, bits: Int) extends Co
|
||||||
}
|
}
|
||||||
|
|
||||||
override def encode(value: Double) = {
|
override def encode(value: Double) = {
|
||||||
if (value == 0.0)
|
Attempt.successful(BitVector.fromInt(QuantizeDouble(value), bits, ByteOrdering.LittleEndian))
|
||||||
Attempt.successful(BitVector.fromInt(0, bits))
|
|
||||||
else
|
|
||||||
Attempt.successful(BitVector.fromInt(QuantizeDouble(value), bits, ByteOrdering.LittleEndian))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override def decode(buffer: BitVector) = {
|
override def decode(buffer: BitVector) = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue