Pythong is shit

What the fuck is wrong with your language??

Attached: FUKKEN_PYTHON.png (608x226, 10K)

Other urls found in this thread:

docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html
0.30000000000000004.com/
twitter.com/NSFWRedditGif

I'm not even a pythonfag, but here's your (You)

What? How about you respond on the merits of my post instead of being a dismissive asshole?

Stop being a dumbass and go learn what a floating point number is. It's certainly not a python "issue".

Open a fucking file write whatever you want there and fucking
Write the thing you want it to do
Save that shit and fucking run it
Don't write shit on the terminal a retarded shithole nigger you lil shit

Thanks, maybe I came across as the asshole in the OP. Sorry.

Google tells me that this happens with some other languages too. Shit like this is bound to confuse a newcomer to programming like me. Why doesn't Python handle it to show the correct result? Isn't it advertised to be the best language for newbies?

lurk moar
it's called a rounding error

Woah man! Who hurt you?

WTF? It doesn't look like a rounding error, because the inputs are limited to 1 decimal, but somehow the operation (+) introduces the error in the calculation.

Blame it on C
iirc C handels all the defintions in python

docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html
Get your basics together..just bcs an language comes easy, that doesn't mean it does the thinking for you

If you give the interpreter two ints, it will respond with an int. If you give two floats, the result will be a float. It's not that hard, it's just a feature of a non strictly typed language.

Wait? Are you bitching about the float?

Do you not understand floating point numbers?

Could you please refrain to insult Python? My gf exists because of it, dickhead. Apologize now.

weak bait but here is a you anyway

> be you
> a bit slow
> does not understand how floating point numbers work in binary
.1 will not be an exact representation in binary floating point, so there's a rounding error. the language is fine, your brain is what is broken.

May I suggest perl6? Perl6 uses Rational numbers by default, which are stored as a pair of nominator and denominator.

Attached: 2019-02-07_04:26.jpg (176x91, 8K)

dont have this problemm in perl

> Why doesn't Python handle it to show the correct result?
One does not simply "handle" rounding errors in floating point numbers.
That's the closest result you can get given the number of bits used to store the value.

0.30000000000000004.com/

use gmpy if you want to avoid floating point inaccuracies

Due to rounding errors, most floating-point numbers end up being slightly imprecise. As long as this imprecision stays small, it can usually be ignored. However, it also means that numbers expected to be equal (e.g. when calculating the same result through different correct methods) often differ slightly, and a simple equality test fails.

/thread

Attached: FB_IMG_1515823613992.jpg (720x457, 24K)

>#include
std::cout

>The "problem" is mitigated very easily by using double precision floating point numbers instead
No it's not.

PHP does not have this problem.

Attached: IMG_20190207_133149_355.jpg (186x122, 5K)

>0.1 + 0.2
0.3000000000004

>0.1+0.2==0.3
False
>0.3-0.2==0.1
False
>0.4-0.1==0.3
False

Kek

Python you crack me up

php > echo number_format(0.1 + 0.2, 17)."\n";
0.30000000000000004

echo converts it into a string and adjusts it to 0.3.

is this your first time writing code? And instead of finding the cause of the problem on google you decide to shitpost on Jow Forums. Underage and absolutely retarded.

python is the only thing that exposes these 0.00000000000000000000000000000001 numbers to the user