Giter Club home page Giter Club logo

Comments (7)

timokoesters avatar timokoesters commented on June 1, 2024 1

Sounds good! But maybe your last three examples should still start with a = to be consistent with the other notation, e.g.

>> sqrt4
= 2

from kalker.

PaddiM8 avatar PaddiM8 commented on June 1, 2024

This is tricky, because these situations are pretty much estimations, that are accurate enough to be completely correct in a lot of cases. In the first example, it should be possible to verify that it's correct though, so that shouldn't be too hard to improve. In the second one, I'm a bit uncertain. If you type 2.8284271, it's going to tell you that it's approximately sqrt8. However, if you type something like 2sqrt2 that is exactly sqrt8, it would have to look at the original expression to be able to be confident about it being exactly sqrt8, which would be a bit more difficult.

At the moment, I feel like the second example makes a bit more sense than the first one, because it says that the result of the calculation is 2.8284271247, and that number is approximately equal to sqrt8, but I agree that it's still a bit inconsistent.

from kalker.

timokoesters avatar timokoesters commented on June 1, 2024

What do you think about starting all responses with , to be more consistent? And only replace it with = when we are sure. So the second line would be

>> 2 sqrt 2
≈ 2.8284271247 ≈ sqrt 8

Or when it can be verified to be exactly sqrt 8, it should be reordered like this:

>> 2 sqrt 2
= sqrt 8 ≈ 2.8284271247

from kalker.

PaddiM8 avatar PaddiM8 commented on June 1, 2024

That could make sense. It could use for results with a enough decimals to be rounded (like 2sqrt2), and = for results that don't get rounded when they're printed. Examples:

this one returns a lot of decimals, meaning it gets rounded before printing, so a does make sense:

>> 2sqrt2
≈ 2.8284271247 ≈ sqrt 8

this one just returns an integer, so it doesn't get rounded:

>> sqrt4
2

and these can be verified:

>> x ^ 2 = 4
2
>> 0.125
0.125 = 1/8

Yeah I think this would be doable

from kalker.

timokoesters avatar timokoesters commented on June 1, 2024

And for the first example in my screenshot, it should say
x ≈ 2 or x = 2

from kalker.

PaddiM8 avatar PaddiM8 commented on June 1, 2024

Equations are still going to be displayed as approximations for now, since they are sometimes rounded off at the end, and equations would be verified before that stage, so it's going to require some more work. I think the other things mentioned have been implemented though.

from kalker.

sergeevabc avatar sergeevabc commented on June 1, 2024

@timokoesters You may be interested in the following discussion: “Subtracting a value from itself equals not zero”. The output used to be way scarier.

$ kalker204.exe 128.36+126.86-255.22
1.4210854715×10^-14 ≈ 0                

$ kalker220.exe 128.36+126.86-255.22
= 0

$ qalc.exe 128.36+126.86-255.22
128.36 + 126.86 - 255.22 = 0

from kalker.

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.