Java:有没有可用的工具可以让我输入,存储和评估数学公式? [英] Java: Is there a tool available that can allow me input, store, and evaluate math formulas?

查看:80
本文介绍了Java:有没有可用的工具可以让我输入,存储和评估数学公式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即使是非常基本的东西也可以.就像输入和评估x + 1之类的东西一样,其中x是我要指定的变量.

Even something very rudimentary is fine. Like entering and evaluating something like x+1, where x is a variable I get to specify.

我当时在考虑为每个公式使用Strings编写自己的字符串,对正则表达式进行解析等等,但是让我们假设我的目标是尽可能地懒惰,如果有其他选择(尤其是正式的),我宁愿先尝试使用它.

I was thinking of writing my own using Strings for each formula, regex for parsing them, etc., but let's assume my goal is to be as lazy as I can possibly get away with, and that if there's another option (especially a formal one), I'd rather try to use that instead, first.

外面有什么可以做这样的事情吗?

Is there anything out there that does something like this?

推荐答案

您可以考虑使用脚本.参考JDK带有JavaScript实现,您也可以插入其他语言.

You can think about using scripting from Java 6. The reference JDK comes with a JavaScript implementation, and you can plug in other languages too.

这篇关于Java:有没有可用的工具可以让我输入,存储和评估数学公式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆