Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

goplus 0.9.7 rational number support issue #751

Closed
qiukeren opened this issue Aug 5, 2021 · 1 comment
Closed

goplus 0.9.7 rational number support issue #751

qiukeren opened this issue Aug 5, 2021 · 1 comment

Comments

@qiukeren
Copy link
Contributor

qiukeren commented Aug 5, 2021

the playground sample is on main branch, errors can be reproduced on 0.9.7.

playground 测试代码使用main分支,问题都能使用0.9.7复现。

1. Cannot direct print a rational number 3.14r, directly print 3r is ok.

无法直接打印3.14r,可以直接打印3r

https://goplay.qiniu.com/p/valNl8Kgmoe

println(3.14r)

it panics directly.

image

print(3r)

2. Rational number cannot multiply a integer.

无法和整数直接相乘。

https://goplay.qiniu.com/p/vXcwZIYlkqT

x:=3r
x*=2
println(x)

it can not convert the type.
image

3. Cannot use the *= operator

问题比较类似2,无法使用*=之类的运算符来计算,也是因为类型转换的问题。

https://goplay.qiniu.com/p/4l3GbhMZtfF

x:=3r
x*=2r
println(x)

image

@xushiwei xushiwei added this to the Go+ v1.0 milestone Aug 5, 2021
@xushiwei xushiwei changed the title goplus 0.97 rational number support issue goplus 0.9.7 rational number support issue Aug 5, 2021
@xushiwei
Copy link
Member

xushiwei commented Aug 6, 2021

57befb4

@xushiwei xushiwei closed this as completed Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants