View mode: basic / threaded / horizontal-split · Log in · Help
January 20, 2013
[Issue 9357] New: Floating-point literal should always be printed with a period
http://d.puremagic.com/issues/show_bug.cgi?id=9357

          Summary: Floating-point literal should always be printed with a
                   period
          Product: D
          Version: D2
         Platform: All
       OS/Version: All
           Status: NEW
         Keywords: pull
         Severity: normal
         Priority: P2
        Component: DMD
       AssignedTo: andrej.mitrovich@gmail.com
       ReportedBy: andrej.mitrovich@gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-01-20 10:00:30 PST ---
void main()
{
   int x = 1.0;
}

Error: cannot implicitly convert expression (1) of type double to int

It should be "expression (1.0)". Opened as a separate cause of:
http://d.puremagic.com/issues/show_bug.cgi?id=8807

There are likely similar issues caused by this.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 20, 2013
[Issue 9357] Floating-point literal should always be printed with a period
http://d.puremagic.com/issues/show_bug.cgi?id=9357



--- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-01-20 10:15:32 PST ---
https://github.com/D-Programming-Language/dmd/pull/1520

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 20, 2013
[Issue 9357] Floating-point literal should always be printed with a period
http://d.puremagic.com/issues/show_bug.cgi?id=9357


bearophile_hugs@eml.cc changed:

          What    |Removed                     |Added
----------------------------------------------------------------------------
                CC|                            |bearophile_hugs@eml.cc


--- Comment #2 from bearophile_hugs@eml.cc 2013-01-20 10:19:17 PST ---
Is this enhancement request only about error messages?


This prints "1":

import std.stdio: writeln;
void main() {
   double x = 1.0;
   writeln(x);
}


While in Python it always prints the leading ".0":

>>> x = 1.0
>>> x
1.0

I'd like writeln() to do the same. It helps tell part FP from integral values
in printouts, etc.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 20, 2013
[Issue 9357] Floating-point literal should always be printed with a period
http://d.puremagic.com/issues/show_bug.cgi?id=9357



--- Comment #3 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-01-20 10:27:24 PST ---
(In reply to comment #2)
> Is this enhancement request only about error messages?
> 
> 
> This prints "1":
> 
> import std.stdio: writeln;
> void main() {
>     double x = 1.0;
>     writeln(x);
> }
> 
> 
> While in Python it always prints the leading ".0":
> 
> >>> x = 1.0
> >>> x
> 1.0
> 
> I'd like writeln() to do the same. It helps tell part FP from integral values
> in printouts, etc.

Nice catch. Please file this as another report since it's a library issue, I'll
rename the current issue so it's obvious it's a compiler issue.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 20, 2013
[Issue 9357] Floating-point literal should always be printed with a period in diagnostic errors
http://d.puremagic.com/issues/show_bug.cgi?id=9357



--- Comment #4 from bearophile_hugs@eml.cc 2013-01-20 15:18:40 PST ---
(In reply to comment #3)

> Nice catch. Please file this as another report since it's a library issue, I'll
> rename the current issue so it's obvious it's a compiler issue.

I can't find the number, but I think this ER is already in bugzilla :-)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 08, 2013
[Issue 9357] Floating-point literal should always be printed with a period in diagnostic errors
http://d.puremagic.com/issues/show_bug.cgi?id=9357


Andrej Mitrovic <andrej.mitrovich@gmail.com> changed:

          What    |Removed                     |Added
----------------------------------------------------------------------------
          Keywords|                            |pull
        AssignedTo|nobody@puremagic.com        |andrej.mitrovich@gmail.com


--- Comment #5 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-02-08 15:14:32 PST ---
New pull:

https://github.com/D-Programming-Language/dmd/pull/1649

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 09, 2013
[Issue 9357] Floating-point literal should always be printed with a period in diagnostic errors
http://d.puremagic.com/issues/show_bug.cgi?id=9357


yebblies <yebblies@gmail.com> changed:

          What    |Removed                     |Added
----------------------------------------------------------------------------
            Status|NEW                         |RESOLVED
                CC|                            |yebblies@gmail.com
        Resolution|                            |FIXED


--- Comment #6 from yebblies <yebblies@gmail.com> 2013-02-09 21:53:58 EST ---
https://github.com/D-Programming-Language/dmd/commit/8f3c1ef7f4914c6959745b66b8335d0c53a281eb

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Top | Discussion index | About this forum | D home