[kaffe] Bug Report: Math.round() problem

Mr Carrot mr_carrot_73 at hotmail.com
Wed Feb 25 09:39:15 PST 2004


Hello.

I have found that Math.round() returns a large negative number instead of returning the rounded version of the argument.  I am using Kaffe version 1.0.7.

Here is a test program that illustrates the problem:
public class HelloWorld
{
  public static void main(String[] args)
  {
    System.out.println("Hello World");
    System.out.print("Math.round(100D) = ");
    System.out.println(Math.round(100D));
    System.out.print("Math.floor(100D) = ");
    System.out.println(Math.floor(100D));
  }
}

Here is the output from running this program:
$ /usr/local/kaffe/bin/kaffe HelloWorld
Hello World
Math.round(100D) = -9223372036854775808
Math.floor(100D) = 100.0
$ 

Here is the output when I use "Sun Java 1.3.0_02" to run it:
$ java HelloWorld
Hello World
Math.round(100D) = 100
Math.floor(100D) = 100.0
$ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://kaffe.org/pipermail/kaffe/attachments/20040225/c733090d/attachment-0007.htm 


More information about the kaffe mailing list