Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用Apache Commons Math来求解线性代数中的方程。默认情况下,它使用以 10 为底的数字系统。但我想使用base-3系统。有没有 API 可以做到这一点?或者我应该使用不同的库?
诶?我不确定这个问题是否有意义。
int,double等都独立于基本系统。只有当您进行输入/输出并转换为/从String时,基础才重要。
int
double
String
...所以基本上,像往常一样使用 Apache,然后以基数 3 输出结果...?
只需在base 10中进行数学运算,然后在输出时将其转换为base 3。数字的“基数”仅仅是一种表示。
如果您需要帮助从 base 10 转换为任何其他 base,请告诉我,我会为您指明正确的方向。