-1

there are a lot of tools could be used to compute square roots.

for instance, with Python NumPy

np.sqrt(80)

outputs

8.94427190999916

is there a way (or a 3rd party package) to have

sqrt(80)

output

$4\sqrt{5}$

  • This is not a math question, rather a programming question, so I've voted to close. But what you want is sympy. – spaceisdarkgreen Jun 25 '19 at 02:05
  • you could write code to solve the equation $$n=x\sqrt{y}$$ where $x$ and $y$ are integers. Giving this function the value of $n$, you get back $x,y$. You could then format the output as you desire. In your case, $n=8.94427190999916$, $x=4$ and $y=5$. It maybe good to include this fact in your question text. The problem boils down to converting an irrational number to an expression with a root. However, I don't think it is always possible. – NoChance Jun 25 '19 at 02:16

1 Answers1

1

sympy could meet your need

sqrt(80)

outputs $4\sqrt{5}$

enter image description here

Jay
  • 511
  • 2
  • 7