diff options
-rwxr-xr-x | etc/ratios.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/etc/ratios.py b/etc/ratios.py index 3748936f0..9c0930cf1 100755 --- a/etc/ratios.py +++ b/etc/ratios.py @@ -8,12 +8,16 @@ try: curve, variant, time = line.split() if curve not in curves: curves[curve] = {} - curves[curve][variant] = time + curves[curve][variant] = float(time) except EOFError: pass for curve, variants in curves.items(): - if 'fiat_solinas64' in variants and 'gmpvar64' in variants: - print(curve, float(variants['gmpvar64']) / float(variants['fiat_solinas64'])) - if 'fiat_solinas32' in variants and 'gmpvar32' in variants: - print(curve, float(variants['gmpvar32']) / float(variants['fiat_solinas32'])) + def compare(fiat, other): + if fiat in variants and other in variants: + print(curve, variants[other] / variants[fiat]) + + compare('fiat_solinas64', 'gmpvar64') + compare('fiat_solinas32', 'gmpvar32') + compare('fiat_montgomery64', 'gmpvar64') + compare('fiat_montgomery32', 'gmpvar32') |