Comments (7)
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.
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.
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.
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.
And for the first example in my screenshot, it should say
x ≈ 2
or x = 2
from kalker.
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.
@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)
- thread 'main' has overflowed its stack
- Big Integers are incorrect resulting in errors doing modular arithmetic HOT 2
- 1e3 != 1000. HOT 1
- Issue to build version 2.1.0 on Arch Linux (AUR package) HOT 10
- Broken link in kalk README HOT 1
- Inconsistent sqrt syntax HOT 4
- Variable assignment doesn't work HOT 1
- Weird results when executing multiple commands at once HOT 1
- Weird results when using ≈ in equations HOT 1
- solving `sin x = 0`: undefined variable
- Kalker wont build on windows HOT 3
- Very numbers become complex numbers? HOT 1
- Disable starting each response with = HOT 1
- unable to solve x^5-x+1=0
- Output version HOT 1
- [FEATURE] support for normal CDF
- About / Announcing kalker Flutter frontend
- `f(` hangs the repl HOT 3
- Interface HOT 2
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 kalker.