Skip to content

Commit

Permalink
added stub [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
dktapps committed Oct 16, 2020
1 parent 3254574 commit 8a11c94
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions stub.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

/**
* Creates a Morton code using the 32 least significant bits of two components
* Note: Uniqueness is only guaranteed when both components are in the range -2147483648 ... 2147483657
*/
function morton2d_encode(int $x, int $y) : int{}

/**
* Creates a Morton code using the 21 least significant bits of three components
* Note: Uniqueness is only guaranteed when both components are in the range -1048576 ... 1048575
*/
function morton3d_encode(int $x, int $y, int $z) : int{}

/**
* Decodes a 2D Morton code into its 32-bit components, including sign bits.
* Note: If the inputs used more than 31 bits (excluding sign bit), the results of this function might be different than
* the original inputs.
*
* @return int[]
* @phpstan-return array{int, int}
*/
function morton2d_decode(int $morton) : array{}

/**
* Decodes a 3D Morton code into its 21-bit components, including sign bits.
* Note: If the inputs used more than 20 bits (excluding sign bit), the results of this function might be different than
* the original inputs.
*
* @return int[]
* @phpstan-return array{int, int, int}
*/
function morton3d_decode(int $morton) : array{}

0 comments on commit 8a11c94

Please sign in to comment.