julia - Julia:在 Pluto 中获取运行时输入
问题描述
我在 Pluto 笔记本中编写了以下代码
begin
function newton_sqrt(x,error_margin)
a=x/2
e=abs(a-x/a)
while e>error_margin
a=(a+x/a)/2
e=abs(a-x/a)
end
println(a)
end
print("Input an integer: ")
x = BigFloat(readline())
newton_sqrt(x,0.0001)
end
我收到错误“ArgumentError:无法将“”解析为 BigFloat”。我无法从提示中获取输入。
任何帮助都会得到深深的承认。
解决方案
推荐阅读
- html - 如何使元素具有相对位置和绝对位置?
- r - 如何使用 R 中的 pdp 计算 3d 部分依赖图?
- python - 使用 subprocess.run 进行 GRPC ssl 脚本编写时遇到问题 [Python]
- python - .get_text() 在 BeautifulSoup 中不起作用
- hyperledger-fabric - Hyperledger Fabric 网络配置问题
- javascript - 拒绝执行内联脚本,因为它违反了以下内容-基于 react 的 chrome 应用程序的内容安全策略指令
- typescript - 如何用一种类型定义正常功能
- flutter - 如何在颤振多模块项目中注入依赖项
- regex - 如何确保分隔符之间的完整字符串符合正则表达式模式?
- c - 用C计算程序的执行时间