Cplex(十进制数) [英] Cplex(number of decimal)
本文介绍了Cplex(十进制数)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在此处输入图片描述如何增加位数$是否在CPLEX中用逗号(小数点后的数字)后面的b $ b作为对象?
enter image description here how can I increase the number of digits after the comma (number of decimal) in CPLEX for objectif fonction?
衷心感谢
?
推荐答案
您可以阅读以下CPLEX技术说明:
You could read this CPLEX technote:
http://www-01.ibm.com/support/docview.wss?uid=swg21615825
我举了一个例子
float f = sqrt(2);
execute {
function formatFloat_prec8 (f) {
f = Math.round(f*100000000);
var fs = f.toString();
fs = fs.substring(0,fs.length-8)+','+fs.substring(fs.length-8,fs.length);
return fs;
}
writeln(formatFloat_prec8(f));
};
这给出了
1,41421356
这篇关于Cplex(十进制数)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文