www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 794] New: std.math.exp2(0) equals 0 instead of 1

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=794

           Summary: std.math.exp2(0) equals 0 instead of 1
           Product: D
           Version: 1.00
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: major
          Priority: P2
         Component: Phobos
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: Robert christina-fritsch.de





-- 
Jan 04 2007
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=794






Must be something wrong with the C run-time:

import std.c.math, std.stdio;
void main()
{
  writefln( std.c.math.exp2f(0.0f) );
  writefln( std.c.math.exp2(0.0) );
  writefln( std.c.math.exp2l(0.0) );
}

These all print 0; when passing 0.00000000001 they'll correctly print 1.


-- 
Jan 05 2007