|
Quote: Dividing by (x-y), obtain ...
... an "out of cheese" error.
(Or a DivideByZeroException if you've not got an Anthill inside[^].)
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I don't know where the documentation writers at MSDN went to school, but I always learned that 1/3 is 0.3333... not 0.9999...
See the code example here[^]
//edit
Nevermind. I can't read. Thanks, @Lopatir
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
modified 9-Mar-17 11:57am.
|
|
|
|
|
look again
decimal dividend = Decimal.One;
decimal divisor = 3;
Console.WriteLine(dividend/divisor * divisor);
1 / 3 * 3 =/= 0.3333
Sin tack
the any key okay
|
|
|
|
|
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
TheGreatAndPowerfulOz but I always learned that 1/3 is 0.3333... not 0.9999 Alternative Math.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Apparently we both can't read.
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
TheGreatAndPowerfulOzApparently we both can't read. Don't include me in your club.
I read it fine. I was making a subtle joke, apparently too subtle.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
I think he was referring to the Donald?
|
|
|
|
|
eww
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
That'd be fake math, wouldn't it?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
|
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
TheGreatAndPowerfulOz< wrote: but I always learned that 1/3 is 0.3333 In that case, your math wasn't much better...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
Octal. It must be octal.
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
I ran the code in LINQPad ( LINQPad - The .NET Programmer's Playground[^] ) and it saved me from thinking at all.
I just looked at the output.
0.9999999999999999999999999999
Otherwise I was thinking it was supposed to be 0.3333 also.
Intellisense is the only sense I have.
Edit
Also, I tried this in Win10 Calculator and it told me that
1 / 3 = 0
I believe calculator, whatever it says.
Oops, then I noticed it was set to Programmer mode. hahahaa 
|
|
|
|
|
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
Nothing strange about that, I can confirm that 1 / 3 = 0, even my calculator agrees (well it had better agree with me)
|
|
|
|
|
Yes, but have you checked for all divisor values larger than 1?
Please do so and report back. 
|
|
|
|
|
That's a lot of work to do myself, but my calculator can do that
|
|
|
|
|
raddevus wrote: then I noticed it was set to Programmer mode. So the full readout was 1 / 3 = 0, and will continue to do so until you give me bacon .
You just need a calculator with a bigger screen.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
|
SSN is a required field.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
"Let him who hath understanding reckon the number of the beast. For it is a human number. Its number is a social security one". Nah, doesn't work.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
Not surprising. When SSN's were first issued that's what people believed - that it was the mark of the beast.
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|