Click here to Skip to main content
15,923,376 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: What is Sign of 0? Pin
Bassam Abdul-Baki2-May-16 5:09
professionalBassam Abdul-Baki2-May-16 5:09 
GeneralRe: What is Sign of 0? Pin
Kirk 103898213-May-16 7:20
Kirk 103898213-May-16 7:20 
GeneralRe: What is Sign of 0? Pin
OriginalGriff2-May-16 5:11
mveOriginalGriff2-May-16 5:11 
GeneralRe: What is Sign of 0? Pin
Marc Clifton2-May-16 5:33
mvaMarc Clifton2-May-16 5:33 
QuestionRe: What is Sign of 0? Pin
Matt T Heffron2-May-16 7:44
professionalMatt T Heffron2-May-16 7:44 
AnswerRe: What is Sign of 0? Pin
Chris @ SAS7-May-16 13:13
Chris @ SAS7-May-16 13:13 
GeneralRe: What is Sign of 0? Pin
Matt T Heffron7-May-16 20:26
professionalMatt T Heffron7-May-16 20:26 
GeneralRe: What is Sign of 0? Pin
Jochen Arndt2-May-16 5:17
professionalJochen Arndt2-May-16 5:17 
So they decided to look at C/C++ and implement the copysign - C++ Reference[^] but not the signbit - C++ Reference[^]?

That is indeed half-baked.

Marc Clifton wrote:
Anyways, I found that weird / interesting. How can 0 be negative?

This can occur when an operation underflows. If you have for example two very small number where one is negative and multiply them, the result can underflow and will be set to zero but the sign bit is preserved.
GeneralRe: What is Sign of 0? Pin
Marc Clifton2-May-16 5:34
mvaMarc Clifton2-May-16 5:34 
GeneralRe: What is Sign of 0? Pin
R. Giskard Reventlov2-May-16 5:27
R. Giskard Reventlov2-May-16 5:27 
GeneralRe: What is Sign of 0? Pin
90823652-May-16 5:35
90823652-May-16 5:35 
GeneralRe: What is Sign of 0? Pin
Sander Rossel2-May-16 5:50
professionalSander Rossel2-May-16 5:50 
GeneralRe: What is Sign of 0? Pin
Marc Clifton2-May-16 10:40
mvaMarc Clifton2-May-16 10:40 
GeneralRe: What is Sign of 0? Pin
Sander Rossel2-May-16 11:25
professionalSander Rossel2-May-16 11:25 
GeneralRe: What is Sign of 0? Pin
Mark_Wallace2-May-16 7:01
Mark_Wallace2-May-16 7:01 
GeneralRe: What is Sign of 0? Pin
Kornfeld Eliyahu Peter2-May-16 7:19
professionalKornfeld Eliyahu Peter2-May-16 7:19 
GeneralRe: What is Sign of 0? Pin
patbob2-May-16 7:59
patbob2-May-16 7:59 
GeneralRe: What is Sign of 0? Pin
Daniel Pfeffer2-May-16 22:35
professionalDaniel Pfeffer2-May-16 22:35 
GeneralRe: What is Sign of 0? Pin
benf23-May-16 1:32
benf23-May-16 1:32 
GeneralRe: What is Sign of 0? Pin
Kiriander2-May-16 21:36
Kiriander2-May-16 21:36 
GeneralRe: What is Sign of 0? Pin
Ygnaiih3-May-16 7:24
professionalYgnaiih3-May-16 7:24 
GeneralRe: What is Sign of 0? Pin
ormonds3-May-16 12:03
ormonds3-May-16 12:03 
GeneralRe: What is Sign of 0? Pin
Charles Programmer4-May-16 3:06
Charles Programmer4-May-16 3:06 
GeneralRe: What is Sign of 0? Pin
Charles Programmer4-May-16 3:06
Charles Programmer4-May-16 3:06 
GeneralI don't laugh at programming themed cartoons Pin
BGArts2-May-16 4:40
BGArts2-May-16 4:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.