Comments (7)
Python can handle large number as bignum. You need to use math/big in Go or Anko.
from anko.
You can use python validation:
from anko.
This is different between static typed literal and dynamic typed literal.
See https://go.dev/play/p/FDAs2CW-Arf
from anko.
anko:
env := env.NewEnv()
v, _ := vm.Execute(env, nil, "2/3")
fmt.Println("result: ", v)
output: result: 0.6666666666666666
python:
2/3
0.6666666666666666
2//3
0
So how should anko behave ?
from anko.
Try below in anko
println((((2871.0*7446.0 + (4929.0 - 3435.0)) / ((754.0 * 5717.0) + (13.0 * 964.0))) - (6940.0 * 2554.0 * 8394.0 * 6115.0 * (811.0 * 4990.0 * (4305.0 + 6293.0))) - (2399.0 + 2562.0 + (8560.0/7616.0)/(2106.0*3816.0)/(4516.0/9112.0) - ((4153.0*5871.0)/7072.0-6863.0)*(3101.0+2727.0-(4537.0*3626.0)))))
from anko.
(6940.0 * 2554 * 8394 * 6115 * 42888940220)
(6940 * 2554 * 8394 * 6115 * 42888940220)
A part of this 2554 * 8394 * 6115 * 42888940220
, this become overflow in int64.
from anko.
https://go.dev/play/p/F-t94NmgrBc
from anko.
Related Issues (20)
- Execute function instead of whole script HOT 6
- Master branch doesn't follow releases HOT 14
- dangerous packages import HOT 10
- goroutine crash silently HOT 14
- Cannot use vm in multiple goroutines HOT 3
- Method overriding in custom structs HOT 11
- unknown field 'Structs' in struct literal of type ast.TypeStruct HOT 9
- Anon calls doesn't report the expr position HOT 4
- Could I throw an error in script for anko to catch and return it to caller HOT 7
- Crashed by invalid input
- question: extending slices and getting data out HOT 1
- Can a function be created
- when "new" and "make" structure, field will not be zero value.
- Playground (http://play-anko.appspot.com/) returns 500 HOT 5
- undefined symbol 'Atoi' HOT 1
- Methods definition
- How can I get the result HOT 5
- How to check if a channel is closed? HOT 1
- Data race when running scripts concurrently HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anko.