To calculate the number of cylinders, start by calculating the number of logical blocks, which indicates volume capacity measured in blocks.
number-of-logical-blocks = volume-capacity-in-bytes / 512
Then use the following formula to calculate the number of cylinders:
number-of-cylinders = ceiling(ceiling(number-of-logical-blocks / 512) / 15)