Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Mar 2010 18:39:22 +0300
From:      Alexander Motin <mav@FreeBSD.org>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        freebsd-arm@FreeBSD.org
Subject:   Re: printf(long double)
Message-ID:  <4BB21B2A.6090209@FreeBSD.org>
In-Reply-To: <20100330.090525.956847443318914833.imp@bsdimp.com>
References:  <4BB1C5C9.8000402@FreeBSD.org> <20100330.090525.956847443318914833.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
M. Warner Losh wrote:
> In message: <4BB1C5C9.8000402@FreeBSD.org>
>             Alexander Motin <mav@FreeBSD.org> writes:
> : Playing with SheevaPlug (Marvell 88F6281 rev A0) with fresh 9-CURRENT
> : I've found that many system statistics utilities are lying, showing
> : number few times smaller then expected. After some investigation I've
> : found that the problem possibly goes from different meaning of (long
> : double) type for compiler and printf() code.
> 
> Yes.  That's possible.  Your code has some mis-match between printf
> args, which most likely is causing problems.

OK, it was wrong indeed. But that is not the reason, but coincidence.
Here is fixed code:
#include <stdio.h>
int
main (void)
{
        printf("%Lf %f\n", (long double)14.5, (double)14.5);
        return(0);
}

It compiles cleanly on both arm and amd64, but still not working on arm:
%./a.out
6.500000 14.500000

-- 
Alexander Motin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4BB21B2A.6090209>