public function writeDouble(Stream $stream, $value) { $bytes = pack('d*', $value); if ($this->isBigEndian) { $bytes = strrev($bytes); } $this->writeBytes($stream, $bytes, 8); }
/** * @dataProvider providerDouble */ public function testComputeDoubleSize($value) { $stream = Stream::create(); $this->writer->writeDouble($stream, $value); $streamSize = $stream->getSize(); $actualSize = $this->calculator->computeDoubleSize($value); $this->assertEquals($streamSize, $actualSize); }