Sha256: 7a237d1c6c6ebcdd0c7df5562d92367d8902aba85058b795736e481a28e337aa
Contents?: true
Size: 357 Bytes
Versions: 315
Compression:
Stored size: 357 Bytes
Contents
#include "grains.h" #define NUMBER_OF_SQUARES (64) uint64_t square(uint8_t index) { if ((!index) || (index > NUMBER_OF_SQUARES)) { return 0; } return (uint64_t) 1 << (index - 1); } uint64_t total(void) { uint64_t result = 0; for (uint8_t i = 1; i <= NUMBER_OF_SQUARES; i++) { result += square(i); } return result; }
Version data entries
315 entries across 315 versions & 1 rubygems