Comment

Comment by noobie

They simply rounded the weights in pounds to the next hundred which resulted in the extra 644lbs.

Python code:

    import math
    def roundup(x):
	return int(math.ceil(x / 100.0)) * 100

    materials_in_kgs =  [12750000,6090000,5420000,2050000,1340000,86000,18000,20000,59000,2000,3000,1000]
    materials_in_lbs = [i*2.204 for i in materials_in_kgs]

    materials_in_lbs_rounded = [roundup(i) for i in materials_in_lbs]

    print sum(materials_in_lbs_rounded)
parent noobie 10 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton