ccalc 0.7.0

Command-line calculator with accumulator, memory cells, multi-base arithmetic, and script file support
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Data storage unit conversions
# Shows the real GiB capacity of a "500 GB" drive (manufacturers use 10^9 bytes)
#
# Usage: ccalc < data_storage.ccalc

1024;                    # 1 KB
m1;
1024 * m1;               # 1 MB
m2;
1024 * m2;               # 1 GB
m3;

500 * 1000^3;            # manufacturer bytes in "500 GB"
/ m3;                    # convert to real GiB
print "Real GiB in a 500 GB drive:"