mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-01-19 18:14:44 +00:00
Fixes encoding 0.0 as q_double (#33)
This commit is contained in:
parent
9d76d08948
commit
c03b29b2bd
|
|
@ -37,10 +37,7 @@ final class QuantizedDoubleCodec(min: Double, max: Double, bits: Int) extends Co
|
|||
}
|
||||
|
||||
override def encode(value: Double) = {
|
||||
if (value == 0.0)
|
||||
Attempt.successful(BitVector.fromInt(0, bits))
|
||||
else
|
||||
Attempt.successful(BitVector.fromInt(QuantizeDouble(value), bits, ByteOrdering.LittleEndian))
|
||||
Attempt.successful(BitVector.fromInt(QuantizeDouble(value), bits, ByteOrdering.LittleEndian))
|
||||
}
|
||||
|
||||
override def decode(buffer: BitVector) = {
|
||||
|
|
|
|||
Loading…
Reference in a new issue