Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ac90160

Browse files
validate for negative values when using sqrt or log10
1 parent ddc1058 commit ac90160

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎src/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ def plot_function(self):
7676
self.show_error_message("Min value must be less than Max value.")
7777
return
7878

79+
if ("log10" in function or "sqrt" in function) and min_x < 0:
80+
self.show_error_message(
81+
"Min value must be non-negative for functions with log10 or sqrt."
82+
)
83+
return
84+
7985
x = np.linspace(min_x, max_x, 400)
8086
try:
8187
y = eval(self.prepare_function(function, x))

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /