Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | 132x 132x 132x 25x 25x 25x 23x 23x 1x 1x 1x 1x | import { EncodeContext } from '../encode'; export function encodeNaN(): void { } export function encodePositiveInfinity(): void { } export function encodeNegativeInfinity(): void { } export function encodeInt(value: number, context: EncodeContext): void { const { writer, values } = context; values.push(value); writer.writeIntVar(value); } export function encodeFloat(value: number, context: EncodeContext): void { const { writer, values, floatQuality } = context; values.push(value); switch (floatQuality) { case 'double': writer.writeFloat64(value); break; case 'single': writer.writeFloat32(value); break; default: writer.writeIntVar(Math.floor(value * floatQuality)); break; } } |