Why Is This Happening?! Floating Point Approximation

Why Is This Happening?! Floating Point Approximation

b001

1 год назад

125,380 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@DiaborMagics
@DiaborMagics - 06.11.2023 16:20

What is the best way to deal with this issue in java (eclipse)?
Also, why do integers not seem to have this problem? Shouldnt a 3 be hard to represent no matter what?

Ответить
@ic_1234
@ic_1234 - 18.10.2023 00:57

what theme is this?

Ответить
@PineCPP
@PineCPP - 04.10.2023 18:35

I don't wanna deal with this sort of thing so I just moved to cpp lol

Ответить
@michaeldibb
@michaeldibb - 02.09.2023 21:51

I understand the method used to represent Floating point, but to my mind it would make calculations a lot easier if the decimals were converted to integers first by multiplying by exponents ie. 0.6x10^1 + 0.7x10^1 = 6+7 = 13x10^-1 = 1.3 Obviously I'm missing something as the computer industry doesn't use this system, except maybe financial software.

Ответить
@swrcPATCH
@swrcPATCH - 12.08.2023 01:07

Would be cool to then explain what decimal does to make it 'work' ...

Ответить
@AdrianGonzalez-tg1te
@AdrianGonzalez-tg1te - 15.07.2023 13:36

Thank you for this great video, I was struggling to really understand the issue with this until I watched it!

Ответить
@atharvapatil6003
@atharvapatil6003 - 14.06.2023 11:37

Great explanation 😊

Ответить
@codewyuu
@codewyuu - 06.05.2023 15:03

Skill issue 😔

Ответить
@keithdavis969
@keithdavis969 - 03.05.2023 17:15

This is the clearest explanation I have found. Thank you.

Ответить
@datasBigdatascreationsGTTB
@datasBigdatascreationsGTTB - 25.02.2023 15:47

use pi

Ответить
@iambilalahmad-
@iambilalahmad- - 16.01.2023 22:52

For Collaboration!
Please Check your dm or Email.

Ответить
@NoNameGuy_
@NoNameGuy_ - 12.01.2023 12:44

x = 0.7
y = 0.6

print(x+y//1)

Output : 0.7
Why ??

Ответить
@Liuk3
@Liuk3 - 03.01.2023 20:58

Does anyone know what font is he using?

Ответить
@allezvenga7617
@allezvenga7617 - 24.12.2022 08:31

Thanks for your sharing

Ответить
@reynoldskynaston9529
@reynoldskynaston9529 - 21.12.2022 23:26

Easier way imo would just be to represent the money as an int in cents and just add the decimal later. 60 + 70 = 130 cents

Ответить
@issac332
@issac332 - 21.12.2022 15:50

микро пон

Ответить
@martinkuliza
@martinkuliza - 21.12.2022 14:26

2"51 awww wfuck.... he just mentioned THE MANTISSA...........Shit just got real

Ответить
@sachinchandanshiv7578
@sachinchandanshiv7578 - 21.12.2022 13:34

Hi Sir,
In below code not getting how, lst1 is appended with element 6 when we are appending only lst2 only.
Can you please Clarify, Thanks

lst1=[1,2,3,4,5]
lst2=lst1
lst2.append(6)
print('lst1- ',lst1)
print('lst2- ',lst2)

Output-
lst1- [1, 2, 3, 4, 5, 6]
lst2- [1, 2, 3, 4, 5, 6]

Ответить
@rad6626
@rad6626 - 21.12.2022 11:40

Make a video explaining how the decimal package works

Ответить
@jamil5522
@jamil5522 - 20.12.2022 13:02

What's the theme you're using?

Ответить
@rabbiezekielgoldberg2497
@rabbiezekielgoldberg2497 - 20.12.2022 11:05

print("%.1f" % x)

Ответить
@jomsies
@jomsies - 20.12.2022 03:51

This makes me want to never code in my life 😂

Ответить
@JayTemple
@JayTemple - 20.12.2022 01:22

It certainly casts doubt on the claim that 0.99999... is equal to 1!

Ответить
@dracula_69
@dracula_69 - 19.12.2022 14:45

Does this only happen in python ? Coz I don't see such issue in c++

Ответить
@histrion2
@histrion2 - 19.12.2022 03:24

So two questions: 1. How does the Decimal function work? 2. What about a continued fraction representation?

Ответить
@testales
@testales - 19.12.2022 02:17

It can also be fun to check whether x = y if one or both are the result of some calcuation, I'd say quite some developers had this to learn the hard way. ;-)

Ответить
@dablju105
@dablju105 - 19.12.2022 00:57

whats ur vsc theme?

Ответить
@alextorres7295
@alextorres7295 - 18.12.2022 22:43

on c++ this not occur
unless we use "printf" and manually increase the number of decimal places to avoid rounding.

Ответить
@takumifujiwara2073
@takumifujiwara2073 - 18.12.2022 15:40

Is there any way to convert binary scientific to decimal scientific notation? I mean like, a number
L.LLL* 2 ^ LL
to
1.5 * 10 ^ 1

Ответить
@pafnutiytheartist
@pafnutiytheartist - 18.12.2022 02:30

Note: having a 32 bit or 64 bit computer/OS has very little to do with precision of numbers used. You can use 64 bit floats on 32 bit machine and vice versa. It's all down to the programmer.
Examples:
1 most game engines will use 32 bit floats for object positions because you don't usually need extra precision and you'll have to convert to 32 bit for GPU rendering anyway.
2. JavaScript will use 64 bit float for it's "Number" data type regardless of what OS or hardware it's running on.

Ответить
@Bray-wm7hx
@Bray-wm7hx - 17.12.2022 20:08

What theme/colour do you use on Visual Studio Code?

Ответить
@mordirit8727
@mordirit8727 - 17.12.2022 10:40

I just don't understand why the computer doesn't add the numbers ignoring the decimal point, then refactor it in after. It would probably take longer to make it "0.6 + 0.7" > "6 + 7" > "13" > "1.3" and you'd need more space to store the information of the decimal point, but you'd never run into the issue of infinite numbers.

Ответить
@felixmueller7341
@felixmueller7341 - 17.12.2022 02:29

how does the Decimal function fix the problem?

Ответить
@KneeCapThief
@KneeCapThief - 16.12.2022 02:25

I program a little in c++ and i just tested it, using g++ compiler this wasn't a problem for me, both when i used floats and doubles. Why is this?

Ответить
@DiscipleKnight1010
@DiscipleKnight1010 - 15.12.2022 16:00

Why don't computers store 1.3 as 13 and then move the exponent by minus 1?

Ответить
@soniablanche5672
@soniablanche5672 - 15.12.2022 00:29

that's why you should never use floats. If you really need to, then you should probably use libraries that store numbers in numerator/denominator form (this is probably what Decimal does).

Ответить
@denischen8196
@denischen8196 - 14.12.2022 01:48

Why doesn't the last few bits get rounded off when converting back to decimal?

Ответить
@gr4tisfaction
@gr4tisfaction - 11.12.2022 23:11

can you please tell what font are you using?

Ответить
@THEELEMENTKING
@THEELEMENTKING - 11.12.2022 09:25

Wouldn’t changing 0.6 to 0.60 fix this?

Ответить
@Dudiszin
@Dudiszin - 09.12.2022 04:10

underrated channel, this helped me SO much

Ответить
@tomgroenendijk45
@tomgroenendijk45 - 08.12.2022 21:26

What program are you using to Write your code can you send me the link

Ответить
@Dira_1111
@Dira_1111 - 08.12.2022 11:37

People in the comments are true genii

Ответить
@tqrules01
@tqrules01 - 08.12.2022 10:34

Always fun haha doing ints to floats without loosing anything...

Ответить
@Scute_King
@Scute_King - 07.12.2022 19:25

I just understood x and y cause I'm a biology student

Ответить
@fxnezse
@fxnezse - 07.12.2022 17:19

what vsc theme are you using?

Ответить
@elmoreglidingclub3030
@elmoreglidingclub3030 - 07.12.2022 15:53

Excellent insight and explanation. But, big picture, given the compute capacity of chips and the talent of the engineers, this is a problem that should be solved and no longer an issue. Period. As we move ahead with using larger and larger data sets to predict with more and more accuracy, these issues are serious drag coefficient.

Ответить
@anzo284
@anzo284 - 07.12.2022 12:51

what is that python exstension?

Ответить
@BryndanMeyerholtTheRealDeal
@BryndanMeyerholtTheRealDeal - 06.12.2022 17:50

If only computers supported a decimal-based floating point, like in many scientific and graphing calculators. Some computers do, but I mean like as a value type.

Ответить
@Nikioko
@Nikioko - 06.12.2022 16:47

10^(log2 + log3) = 5,99. 😆

Ответить
@PvblivsAelivs
@PvblivsAelivs - 05.12.2022 14:39

If your exponent was a 127, you would get into a "denormal" representation. For most output, however, it is sufficient to use a display precision that is less that the stored precision.

Ответить