The question being answered clearly wanted base2 engineering prefix units, rather than the standard base10 engineering prefix units.
suffixes = [ "EB", "PB", "TB", "GB", "MB", "KB", "B" ]
magnitudes = [ 2^60, 2^50, 2^40, 2^30, 2^20, 2^10, 2^0 ] // Pseudocode, also 64 bit integers required. (Compilers might assume unsigned 32 for int)
The author's code gives an option for the units:
int unit = si ? 1000 : 1024;
The question being answered clearly wanted base2 engineering prefix units, rather than the standard base10 engineering prefix units.
suffixes = [ "EB", "PB", "TB", "GB", "MB", "KB", "B" ]
magnitudes = [ 2^60, 2^50, 2^40, 2^30, 2^20, 2^10, 2^0 ] // Pseudocode, also 64 bit integers required. (Compilers might assume unsigned 32 for int)