Skip to content

Commit

Permalink
Minor python script cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ember91 committed Jul 23, 2022
1 parent 34071c7 commit 2c01ed2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion example/src/if_data_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
file_path = sys.argv[1]
else:
print(f"Usage: {sys.argv[0]} [file]")
exit()
sys.exit()

with open(file_path, "rb") as f:
# Read little endian float32 from file
Expand Down
4 changes: 2 additions & 2 deletions src/calculate_bounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ def pr(name, type_fp, type_int=None, radix=None, lower=None, upper=None):
sign = 1

# Calculate lower and upper limits
if lower == None:
if lower is None:
if sign == 1:
lower = -math.pow(2, bits - radix - sign)
else:
lower = 0.0
if upper == None:
if upper is None:
upper = math.pow(2, bits - radix - sign) - math.pow(2, -radix)

# String fixing and printout
Expand Down

0 comments on commit 2c01ed2

Please sign in to comment.