Answer

问题及解答

[Bug] 分数模式下的错误

Posted by haifeng on 2023-07-06 15:55:19 last update 2023-07-07 20:43:22 | Edit | Answers (0)

>> :mode fraction
Switch into fraction calculating mode.
e.g., 1/2+1/3 will return 5/6

>> printSeries((-1)^n*1/(2*n+1),n,0,10)
1,-1|3,^2|5,-^3|7,^4|9,-^5|11,^6|13,-^7|15,^8|17,-^9|19,^10|21,

------------------------

检查分数运算下是否有BUG

 


numerical 模式下也有BUG.

>> (-1)^(3/2)
in> (-1)^(3/2)

out> 34716454.-1-1-1-1-1-1-1-1-1
------------------------

 


目前修复为

 

>>  printSeries((-1)^n*1/(2*n+1),n,0,10)
1,-1|3,1|5,-1|7,1|9,-1|11,1|13,-1|15,1|17,-1|19,1|21,

------------------------

>> (-1)^(3/2)
in> (-1)^(3/2)

out> (-1)^(1|2)

------------------------