From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1672 invoked by alias); 9 May 2010 23:19:31 -0000 Received: (qmail 1664 invoked by uid 22791); 9 May 2010 23:19:30 -0000 X-SWARE-Spam-Status: No, hits=0.0 required=5.0 tests=AWL,BAYES_40,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SARE_MSGID_LONG45,TW_GC,TW_GT,TW_GX,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-yw0-f191.google.com (HELO mail-yw0-f191.google.com) (209.85.211.191) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 09 May 2010 23:19:27 +0000 Received: by ywh29 with SMTP id 29so1601866ywh.14 for ; Sun, 09 May 2010 16:19:25 -0700 (PDT) Received: by 10.150.56.25 with SMTP id e25mr6839880yba.188.1273447165079; Sun, 09 May 2010 16:19:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.151.150.20 with HTTP; Sun, 9 May 2010 16:19:05 -0700 (PDT) From: Erwin Kalvelagen Date: Sun, 09 May 2010 23:19:00 -0000 Message-ID: Subject: formatting floating point problem To: java@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org X-SW-Source: 2010-05/txt/msg00004.txt.bz2 Hi, I am wondering what I am doing wrong here. erwin@erwin-laptop:~/jtest$ cat tst.java public class tst { public static void main(String[] args) { double d = 0.8; System.out.format("[%g]%n",d); } } erwin@erwin-laptop:~/jtest$ gcj --main=tst tst.java erwin@erwin-laptop:~/jtest$ ./a.out [] erwin@erwin-laptop:~/jtest$ gcj -v Using built-in specs. Reading specs from /usr/lib/gcc/i486-linux-gnu/4.4.3/libgcj.spec rename spec startfile to startfileorig rename spec lib to liborig Target: i486-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-1ubuntu2' --with-bugurl=file:///usr/share/doc/gcj-4.4/README.Bugs --enable-languages=c,c++,java --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --disable-libmudflap --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=//usr/lib/jvm/java-1.5.0-gcj-4.4/jre --enable-java-home --with-jvm-root-dir=//usr/lib/jvm/java-1.5.0-gcj-4.4 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.4 --with-arch-directory=i386 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-targets=all --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu Thread model: posix gcc version 4.4.3 (Ubuntu 4.4.3-1ubuntu2) erwin@erwin-laptop:~/jtest$ With Sun's java I get actually something printed. Thanks, Erwin ---------------------------------------------------------------- Erwin Kalvelagen Amsterdam Optimization Modeling Group erwin@amsterdamoptimization.com http://amsterdamoptimization.com ----------------------------------------------------------------