Skip to content

Commit 29866f1

Browse files
committed
Don't need the square root function
1 parent 7167301 commit 29866f1

File tree

3 files changed

+0
-14
lines changed

3 files changed

+0
-14
lines changed

auto_editor/cmds/test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,6 @@ def cases(*cases: tuple[str, object]) -> None:
577577
("(/ 5)", 0.2),
578578
("(/ 6 1)", 6.0),
579579
("30/1", Fraction(30)),
580-
("(sqrt -4)", 2j),
581580
("(pow 2 3)", 8),
582581
("(pow 4 0.5)", 2.0),
583582
("(abs 1.0)", 1.0),

auto_editor/lang/stdenv.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
def make_standard_env() -> dict[str, Any]:
2828
import os.path
29-
from cmath import sqrt as complex_sqrt
3029
from functools import reduce
3130
from operator import add, ge, gt, is_, le, lt, mod, mul
3231
from subprocess import run
@@ -828,14 +827,6 @@ def int_div(n: int, *m: int) -> int:
828827

829828
return reduce(lambda a, b: a // b, m, n)
830829

831-
def _sqrt(v: Number) -> Number:
832-
r = complex_sqrt(v)
833-
if r.imag == 0:
834-
if int(r.real) == r.real:
835-
return int(r.real)
836-
return r.real
837-
return r
838-
839830
def _xor(*vals: Any) -> bool | BoolList:
840831
if is_boolarr(vals[0]):
841832
check_args("xor", vals, (2, None), (is_boolarr,))
@@ -1052,7 +1043,6 @@ def change_file_ext(a: str, ext: str) -> str:
10521043
"div": Proc("div", int_div, (2, None), is_int),
10531044
"add1": Proc("add1", lambda z: z + 1, (1, 1), is_num),
10541045
"sub1": Proc("sub1", lambda z: z - 1, (1, 1), is_num),
1055-
"sqrt": Proc("sqrt", _sqrt, (1, 1), is_num),
10561046
"real-part": Proc("real-part", lambda v: v.real, (1, 1), is_num),
10571047
"imag-part": Proc("imag-part", lambda v: v.imag, (1, 1), is_num),
10581048
# reals

docs/doc.pal

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,6 @@
367367
(proc "pow" '((z real?) (w real?) real?)
368368
(text "Returns "'z" raised to the "'w" power.")
369369
)
370-
(proc "sqrt" '((z number?) number?)
371-
(text "Returns the square root of "'z".")
372-
)
373370
]
374371
"Modules" #[
375372
(syntax "import" "module" (text "Imports a module"))

0 commit comments

Comments
 (0)