• Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

WHY THE HECK YOU DOING THA... and now you work... WTF?

I can solve everybody else's problems in a few seconds... But to solve problems with my computer, it takes a few hours -_-

Well I was solving a problem at one of those online judges, my answer wasn't accepted because of an epsilon error in floats.

I hate floats/doubles with a passion!
You'll be happy to know, then, that floats and the like should be avoided, especially when doing precision tasks. Computers only estimate floating point precision, and with prolonged precision tasks will start to become inaccurate. It's much better to use integer precision and division, it's much more accurate.
 
like my hd audio driver its a new comp (no problems the initial 4 or 5 weeks) then i was getting blue screen each time i tried booting my game it said viahduua.sys and im like thats my audio driver i had to uninstall and install again now no blue screens yay!!

Drivers pain in the a**. Blue screens make me want to commit suicide.
 
You'll be happy to know, then, that floats and the like should be avoided, especially when doing precision tasks. Computers only estimate floating point precision, and with prolonged precision tasks will start to become inaccurate. It's much better to use integer precision and division, it's much more accurate.
I know... But what can you do when you need to handle fractional / decimal data, at most maybe use double?
 
Drivers are the biggest pain when doing general IT support. Even moreso than dead hardware, in my opinion.

Having had an epic Driver fail that required an absolute minimum of 5 hours of downtime while the computer fixes itself I can't help but agree.
 
I know... But what can you do when you need to handle fractional / decimal data, at most maybe use double?
As long as you're working with rational numbers or something that can be written as an expression, you can use integer data and division or other operations to represent whatever decimal or fraction you want.

This is a rather contrived solution, but let's say you have a number like 3.2 that you want to work with but don't want to use floating point for accuracy reasons. Rather than
Code:
float importantNumber = 3.2;
perhaps you could do
Code:
int importantNumber[2] = {32, -1};
where the first number is an integer representation and the second is the power of ten you need to multiply the first by to get your floating point number. There's probably a better way to do it, but even this way is better than using floats if you need accuracy. If you needed to do a calculation using importantNumber, you could do (importantNumber[0] * 10^(importantNumber[1])) and then whatever calculation you need to do, and then store the result the same way.

It's usually not important for smaller scale applications, but in applications where accuracy is absolutely necessary, you have to do something like this, as floating point representations lose accuracy relatively fast (this includes doubles, as they're still representing a number as a floating point rather than an integer).
 
As long as you're working with rational numbers or something that can be written as an expression, you can use integer data and division or other operations to represent whatever decimal or fraction you want.

This is a rather contrived solution, but let's say you have a number like 3.2 that you want to work with but don't want to use floating point for accuracy reasons. Rather than
Code:
float importantNumber = 3.2;
perhaps you could do
Code:
int importantNumber[2] = {32, -1};
where the first number is an integer representation and the second is the power of ten you need to multiply the first by to get your floating point number. There's probably a better way to do it, but even this way is better than using floats if you need accuracy. If you needed to do a calculation using importantNumber, you could do (importantNumber[0] * 10^(importantNumber[1])) and then whatever calculation you need to do, and then store the result the same way.

It's usually not important for smaller scale applications, but in applications where accuracy is absolutely necessary, you have to do something like this, as floating point representations lose accuracy relatively fast (this includes doubles, as they're still representing a number as a floating point rather than an integer).
If you'd need accurate calculations, the integer part will be huge. Let's say we use long longs instead.
Multiply something like (2^37, -11) * (2^40, -13) (I know, there are better ways to do this, just a random example)... And it's already not going to work. And it is cases like this where accuracy really messes up...

But I get the idea, you could do something like this and make it work with how we store large numbers like 100! in C++ / C.

EDIT: Let's carry on our discussion in the programming thread :)
 
I work in a computer repair shop, so I've seen it all. The funniest has to be the caterpillars that crawled into a power supply and burned it out.

I installed a new graphics card and the machine won't turn on. They'd managed to force a PCI-E card into an AGP slot. No wonder it wouldn't POST.
Oh my O.o

I've had insects into my keyboard, but that's the worst it has been :/
 
I was at school, and we had to do some research for something we'd give the teacher when we'd be done. My subject was "The Colors in the image" so...I had 2 hours, I got on the net, looking for informations, finding informations, then summing them all up in a text on Microsoft Word Office 2007. I was writting and writting and writting and writting, and then the computer randomly froze O.o

I was like : "Wha ?! Work alreaadyyy ! Come on D8"
And yeah. Spent lot of time waiting for it to work...AND it finally "unfroze" and yeah...It was too late, bell had rung -w-

School computer just really are bad.
 
I start playing a laggy online game: Roblox: a Pirate's Life I'm walking over to a bank and I start up my cheat engine. The game starts lagging even more! I change the value of my money from 12 to 1,000,000. Then, It starts to LAG horribly. And when Roblox lags, it crashes. So I'm thinking: (Come on, don't lag, Don't Lag! DON'T LAG, YOU PIECE OF JUNK!) And it crashes. I start it back up and its already in lag mania. I start up cheat engine, and it does the opposite of lag. Epic- Fail.
 
A while ago, I bought a Power Mac G4 at a garage sale. When I brought it home and powered it on, it wouldn't post video. So I replaced the video card, only to find out that the AGP slot in the G4 I have is only a 2x slot (and the card I was trying was an 8x, so it didn't work, of course). I put the original ATI Rage card that came with it back in, and then it worked. >.<

Also, we have an old first-generation Sega Genesis. It was sitting in out basement for the longest time, and I decided to take it out one day. It wouldn't power on. So I cracked it open, and saw that there was nothing wrong on the inside that I could see. When I was putting it back together, I accidentally knocked some caps so that they were at an angle. I bent them back into place, and finished reassembling the system. I plugged it in, and then it started working again.
 
So, last night I jailbroke my iPod touch MC with sn0wbreeze 1.7. It was a pain in the rear end. I follow all the instructions on iH8sn0w's site and it restores, into a recovery boot loop. I begin to freak out, kick it out of the loop with iREB, and then use iBooty to kick it out of recovery mode. Bad idea. Then the screen looked like an old CRT with no signal except it didn't move or make noise. Did it again and it worked magic. :). Almost gave me a heart attack that my $400 MID could have died, but it worked.

Also, the other day, after all that jailbreak happiness, I tried to delete all those files I had to download, except one wouldn't go, so I tried over and over again. Rebooted, the file was gone *facepalm*. This is why I am an Apple/Linux fanboy.

Christ, don't get me started on stupid programming problems! XD

For some weird reason, I was working in C++ and all I wanted this part of the program to do was to print to the console. 'Cout' right? Wrong. No matter what I did it wouldn't work.
I close down the program, re-opened it and it worked! FFFFFFFFFFF! XD

That happens to me all the time, and not just when I'm coding.
 
Back
Top