From 46169e6a75130cd8e0719a39b92a1454279da312 Mon Sep 17 00:00:00 2001 From: pux Date: Mon, 22 Mar 2021 01:06:39 +0100 Subject: floatsy --- calctenna.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/calctenna.py b/calctenna.py index 8bf9bb3..88a6758 100755 --- a/calctenna.py +++ b/calctenna.py @@ -85,12 +85,12 @@ def check_input(frequency, velocity_factor): # fill struct def calc(antenna_data): - c = 299792458 # speed of light - antenna_data.wavelength = float(c) / float(antenna_data.frequency) + c = 299792458.0 # speed of light + antenna_data.wavelength = c / antenna_data.frequency antenna_data.wavelength_2 = antenna_data.wavelength/2 antenna_data.wavelength_4 = antenna_data.wavelength/4 antenna_data.dipole_leg_length = antenna_data.wavelength_4 \ - * float(antenna_data.velocity_factor) + * antenna_data.velocity_factor if __name__ == '__main__': args = run_argparse() @@ -102,7 +102,8 @@ if __name__ == '__main__': if not check_input(args.frequency, args.velocity_factor): exit() - antenna_data = AntennaData(args.frequency, args.velocity_factor) + # check_input OK -> float() + antenna_data = AntennaData(float(args.frequency), float(args.velocity_factor)) calc(antenna_data) if not args.quiet: -- cgit v1.2.2-1-g5e49