From owner-freebsd-arm@FreeBSD.ORG Tue Mar 30 15:39:26 2010 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 713241065742 for ; Tue, 30 Mar 2010 15:39:26 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mx1.freebsd.org (Postfix) with ESMTP id F092C8FC1E for ; Tue, 30 Mar 2010 15:39:25 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id l26so130598fgb.13 for ; Tue, 30 Mar 2010 08:39:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=00alxjXwjwcJSHrKlApSXnIhnF31uokFnbbgu6tZBKM=; b=OBJWpRogbGg9QQfCsEkbnceRpHJhCL18M4mktfjudv1nemTtoPNN8HDK8sXie8qJQI bWbvSPJ+NAVgRWuJDgAcbVtD0LzfC/8Xw+r0VTtLOjtKOUs0IZzA49e8vtxUMZv548bM s2dRtXOItdY/gvagnQJHv7EkTMJWm8R+9bNRI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=Sp9GIOG2mrIWoUWAhCm6QJlpLlkw7+c27Uj8QByY1N/s5S+ayuU8ev1O7J985ARrL0 epdMM1gw/2nKn/HeoAZfaLzMVtISFGM72ITs7xRmhfZGv24nSyE4g0fYu2RPIy7SddIJ Qj27uAAUk7rXk5W8yefF63bz1xx9kvlLprcNE= Received: by 10.87.67.25 with SMTP id u25mr7718655fgk.32.1269963564793; Tue, 30 Mar 2010 08:39:24 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id 15sm4021300fxm.7.2010.03.30.08.39.23 (version=SSLv3 cipher=RC4-MD5); Tue, 30 Mar 2010 08:39:24 -0700 (PDT) Sender: Alexander Motin Message-ID: <4BB21B2A.6090209@FreeBSD.org> Date: Tue, 30 Mar 2010 18:39:22 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: "M. Warner Losh" References: <4BB1C5C9.8000402@FreeBSD.org> <20100330.090525.956847443318914833.imp@bsdimp.com> In-Reply-To: <20100330.090525.956847443318914833.imp@bsdimp.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-arm@FreeBSD.org Subject: Re: printf(long double) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 15:39:26 -0000 M. Warner Losh wrote: > In message: <4BB1C5C9.8000402@FreeBSD.org> > Alexander Motin 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 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