|
Cornelius Henning wrote: that dust cloud disappearing over the horizon will be me on Windows 11
So you're finally goping to yield to insasnity and live in a fantasy land? There will be no Windows 11!
I am not a number. I am a ... no, wait!
|
|
|
|
|
Sander Rossel wrote: Win 7 computer, the last awesome OS
|
|
|
|
|
I installed update 2 on both Windows 8.1 and Windows 10 without an issue. I had no problems with Windows 10 and used it in preference to Windows 7 (on a dual boot system.)
|
|
|
|
|
I have a computer I need to reinstall the OS so that I can install a working version of Visual Studio. Had a bunch of third party control stuff on it, and it broke visual studio when I removed them. Hate 3rd party controls.
|
|
|
|
|
Does Luke Skywalker read PDF's with Adobe Wan Kenobi?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
May the Font be with you!
|
|
|
|
|
I think you gave in to the dark side with that one.
|
|
|
|
|
|
Only if he wants to Foxit up!
I am not a number. I am a ... no, wait!
|
|
|
|
|
Adobe Wan... Now, that's a name I've not heard in a long time. A long time.
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
By now, yoda concluded better 'Thoughts of the Day' would be posted.
Perhaps you should sythe down and think this through.
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "As far as we know, our computer has never had an undetected error." - Weisert | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
|
His pc was broken due to the force update to windows 10
|
|
|
|
|
(waves hand)
These are not the documents you are looking for.
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.
--Winston Churchill
|
|
|
|
|
In C#, Math.Sign(0) is 0. OK, that's one way to solve that.
But I was amused by this comment in SO regarding why there isn't a Sign function in Python:
Indeed there was a patch which included sign() in math, but it wasn't accepted, because they didn't agree on what it should return in all the edge cases (+/-0, +/-nan, etc)
Instead, they created copysign
math.copysign(x, y)
Return x with the sign of y. On a platform that supports signed zeros, copysign(1.0, -0.0) returns -1.0.
So if you do:
math.copysign(15, -313)
you get -15.0.
Or more amusingly:
math.copysign(0, -313)
Answer: -0.0
Then try this:
-0.0 < 0
Answer: False
-0.0 == 0
Answer: True
Anyways, I found that weird / interesting. How can 0 be negative?
Thoughts, on this Monday morning?
Marc
|
|
|
|
|
I'd like to know how they represent -0 internally...
I mean, either they're cutting one number off the max range of the numeric type (e.g. -127->127 instead of -128->127, so 11111111 could represent -0 instead of -1), and changing all of the low-level arithmetic to compensate (unlikely), or...
They're wasting a whole byte on the sign, just so they can represent something that, 99.999% of the time, doesn't matter...
If they're going to go that route, I think they should figure out 254 more ways to represent zero, just so they're not wasting bits
|
|
|
|
|
In Python, copysign returns a floating point value, so they use the sign bit. There is no integer representation of -0. If you try a = -0 , then print a shows 0.
Marc
|
|
|
|
|
Ian Shlasko wrote: I'd like to know how they represent -0 internally...
That's exactly where is the problem. I don't know C# (I'm currently a javascript programmer), but a Number is internally stored as IEEE754 floating point, which have a bit for sign. It is not an integer. Zero can be represented without the sign bit, therefore when sign bit is 0, you get +0.0, when it is 1, you get -0.0. It is just a bit interpretation problem.
If you are interesting why -0.0 work as it is, there is very good mathematical theory for infinitesimals. But as a rule of a thumb, never use == on floating-point number. It returns false more often than you expect to.
|
|
|
|
|
I don't see a problem?
-0 == -1*0 == 0
it ain’t broke, it doesn’t have enough features yet.
modified 20-Oct-19 21:02pm.
|
|
|
|
|
But in Python (note the floating point):
-1.0 * 0.0
-0.0
Marc
|
|
|
|
|
And in C
printf("%f", -1.0 * 0.0)
prints -0.000000
see Signed zero[^] (Wikipedia)
Edit:
should have read the rest of the thread before hitting post ..
|
|
|
|
|
Not only Python.
Try it in SQL Server 2012:
declare @A as float;
declare @B as float;
declare @C as float;
set @A = 0.0;
set @B = -1.0;
set @C = @A * @B;
print @C;
or PHP:
$A = -1.0 * 0.0;
echo $A . "\n";
|
|
|
|
|
The Taurus would be the closest sign.
|
|
|
|
|
Actually, I believe the correct answer is Gemini! (I know I married them)
|
|
|
|
|