| 370 | } |
| 371 | |
| 372 | F32 BitStream::readFloat(S32 bitCount) |
| 373 | { |
| 374 | auto maxInt = (1U << bitCount) - 1; |
| 375 | auto i = static_cast<U32>(readInt(bitCount)); |
| 376 | if (i == 0) |
| 377 | return 0; |
| 378 | if (i == maxInt / 2 + 1) |
| 379 | return 0.5; |
| 380 | if (i == maxInt) |
| 381 | return 1; |
| 382 | return i / static_cast<F32>(maxInt); |
| 383 | } |
| 384 | |
| 385 | void BitStream::writeSignedFloat(F32 f, S32 bitCount) |
| 386 | { |
no outgoing calls
no test coverage detected