Комментарии:
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?
what theme is this?
ОтветитьI don't wanna deal with this sort of thing so I just moved to cpp lol
Ответить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.
ОтветитьWould be cool to then explain what decimal does to make it 'work' ...
ОтветитьThank you for this great video, I was struggling to really understand the issue with this until I watched it!
ОтветитьGreat explanation 😊
ОтветитьSkill issue 😔
ОтветитьThis is the clearest explanation I have found. Thank you.
Ответитьuse pi
ОтветитьFor Collaboration!
Please Check your dm or Email.
x = 0.7
y = 0.6
print(x+y//1)
Output : 0.7
Why ??
Does anyone know what font is he using?
ОтветитьThanks for your sharing
Ответить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
Ответитьмикро пон
Ответить2"51 awww wfuck.... he just mentioned THE MANTISSA...........Shit just got real
Ответить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]
Make a video explaining how the decimal package works
ОтветитьWhat's the theme you're using?
Ответитьprint("%.1f" % x)
ОтветитьThis makes me want to never code in my life 😂
ОтветитьIt certainly casts doubt on the claim that 0.99999... is equal to 1!
ОтветитьDoes this only happen in python ? Coz I don't see such issue in c++
ОтветитьSo two questions: 1. How does the Decimal function work? 2. What about a continued fraction representation?
Ответить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. ;-)
Ответитьwhats ur vsc theme?
Ответитьon c++ this not occur
unless we use "printf" and manually increase the number of decimal places to avoid rounding.
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
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.
What theme/colour do you use on Visual Studio Code?
Ответить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.
Ответитьhow does the Decimal function fix the problem?
Ответить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?
ОтветитьWhy don't computers store 1.3 as 13 and then move the exponent by minus 1?
Ответить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).
ОтветитьWhy doesn't the last few bits get rounded off when converting back to decimal?
Ответитьcan you please tell what font are you using?
ОтветитьWouldn’t changing 0.6 to 0.60 fix this?
Ответитьunderrated channel, this helped me SO much
ОтветитьWhat program are you using to Write your code can you send me the link
ОтветитьPeople in the comments are true genii
ОтветитьAlways fun haha doing ints to floats without loosing anything...
ОтветитьI just understood x and y cause I'm a biology student
Ответитьwhat vsc theme are you using?
Ответить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.
Ответитьwhat is that python exstension?
Ответить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.
Ответить10^(log2 + log3) = 5,99. 😆
Ответить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.
Ответить