# L-25 MCS 260 : flopsum
"""
We use FlopFloats to count the number
of operations when summing n floats.
"""

from flopfloats import FlopFloat
from random import gauss

print('counting flops in a sum' + \
      ' of n floating-point numbers')
N = int(input('Give n : '))
RANDSUM = FlopFloat()
for i in range(0, N):
    RANDSUM = RANDSUM + gauss(0, 1)
print('sum = ' + str(RANDSUM) + \
    ' #flops is %d' % RANDSUM.flops)
