blob: 0ee4b701f4c908ddd135b4ee2caf1e237a59775b [file] [log] [blame]
#!/usr/bin/env bash
# Copyright 2018 The Fuchsia Authors
#
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT
BIT=0
VAL=$1
while (($VAL != 0)); do
printf "%3d: %d\n" $BIT $((VAL & 1))
((VAL >>= 1))
((BIT++))
done