Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 509590

Summary: Sign issue with '+' unary operator and zero literal
Product: [Eclipse Project] JDT Reporter: Jean-Marie HENAFF <jmhenaff>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 4.7   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: stalebug
Attachments:
Description Flags
Sample code to reproduce issue. Just execute run.sh. none

Description Jean-Marie HENAFF CLA 2016-12-21 09:54:47 EST
Created attachment 266012 [details]
Sample code to reproduce issue. Just execute run.sh.

Reproduced with:
ecj-4.7M4
ecj-I20161221-0400

The following code:
System.out.println(+(-0.0f));

gives "0.0" with ecj, and "-0.0" with javac.

If another value than 0.0 is taken (e.g. 1.0), then the same value is output with both compiler (i.e. -1.0).

I've attached a sample code with another example where behavior differs between ecj and javac, this time with Float.NEGATIVE_INFINITY.
Comment 1 Eclipse Genie CLA 2019-09-14 15:01:00 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.