Code Monkey home page Code Monkey logo

Comments (7)

mattn avatar mattn commented on August 23, 2024 1

Python can handle large number as bignum. You need to use math/big in Go or Anko.

from anko.

button-chen avatar button-chen commented on August 23, 2024

You can use python validation:
Uploading calc.png…

from anko.

mattn avatar mattn commented on August 23, 2024

This is different between static typed literal and dynamic typed literal.

See https://go.dev/play/p/FDAs2CW-Arf

from anko.

button-chen avatar button-chen commented on August 23, 2024

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.

mattn avatar mattn commented on August 23, 2024

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.

mattn avatar mattn commented on August 23, 2024

(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.

mattn avatar mattn commented on August 23, 2024

https://go.dev/play/p/F-t94NmgrBc

from anko.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.