Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

freebsd-arm Digest, Vol 209, Issue 2

0 views
Skip to first unread message

freebsd-a...@freebsd.org

unread,
Mar 30, 2010, 8:00:17 AM3/30/10
to freeb...@freebsd.org
Send freebsd-arm mailing list submissions to
freeb...@freebsd.org

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.freebsd.org/mailman/listinfo/freebsd-arm
or, via email, send a message with subject or body 'help' to
freebsd-a...@freebsd.org

You can reach the person managing the list at
freebsd-...@freebsd.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of freebsd-arm digest..."


Today's Topics:

1. printf(long double) (Alexander Motin)


----------------------------------------------------------------------

Message: 1
Date: Tue, 30 Mar 2010 12:35:05 +0300
From: Alexander Motin <m...@FreeBSD.org>
Subject: printf(long double)
To: freeb...@FreeBSD.org
Message-ID: <4BB1C5C9...@FreeBSD.org>
Content-Type: text/plain; charset=KOI8-R

Hi.

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.

I've written small test to check it:
#include <stdio.h>
int
main (void)
{
printf("%d %d\n", sizeof(long double), sizeof(double));
printf("%Lf %f %Lf %f\n", (long double)14.5, (long double)14.5,
(double)14.5, (double)14.5);
}

On amd64 it prints:
# ./a.out
16 8
14.500000 14.500000 14.500000 14.500000

But on arm:
%./a.out
8 8
6.500000 14.500000 6.500000 14.500000

Can somebody comment this?

--
Alexander Motin


------------------------------

End of freebsd-arm Digest, Vol 209, Issue 2
*******************************************

0 new messages