toBe(10.0 ** 6) ->and(divisor(1000, 3))->toBe(10.0 ** 3) ->and(divisor(1000, 0))->toBe(1.0); }); test('base 1024 divides by true binary powers', function () { // the issue example: |95:bits:6:aggregate:2| on a base-1024 graph expect(divisor(1024, 6))->toBe(1024.0 ** 2) ->and(divisor(1024, 3))->toBe(1024.0) ->and(divisor(1024, 0))->toBe(1.0); }); test('the old 10.24 divisor error is gone', function () { // 10.24^6 = 1,152,921.5 overstated the divisor by about 10% $old = 10.24 ** 6; $new = divisor(1024, 6); expect($new)->toBe(1048576.0) ->and($old / $new)->toBeGreaterThan(1.09) ->and($old / $new)->toBeLessThan(1.10); }); test('no 10.24 divisor remains in graph_variables.php', function () { $src = file_get_contents(__DIR__ . '/../../../../lib/graph_variables.php'); expect($src)->not->toBeFalse('Failed to read lib/graph_variables.php'); expect(preg_match('/=\s*10\.24\s*;/', $src))->toBe(0, 'the 10.24 approximation must be gone from code'); });