function decimalismtobinary($number, &$arr=[])
{
array_push($arr, $number%2);
$number = floor($number/2);
if ((int)$number === 0) {
return;
}
decimalismtobinary($number, $arr);
foreach($arr as $k => &$v) {
if((int)$v === 0) {
unset($v);
continue;
}
$v = 2**$k;
}
return $arr;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…