2017-10-15 33 views
1

我已經定義千里馬:如何強制數值計算

log10(x) := log(x)/log(10); 
ndigits(x) := fix(log10(x) + 1); 

當我嘗試應用ndigits的值,我似乎無法得到一個數值結果:

(%i18) NDIGITS(1); 
(%o18)       NDIGITS(1) 
(%i19) float(NDIGITS(1)); 
(%o19)       NDIGITS(1.0) 

我怎樣才能得到一個數值結果在這裏?

回答

1

哦,好吧。我不知道爲什麼千里馬命令行大寫的自動填充,但千里馬是大小寫敏感的

(%i45) ndigits(1); 
(%o45) 

          1