Subject: Re: ldiv problem
To: Luke Mewburn <lukem@wasabisystems.com>
From: Claude Marinier <claude.marinier@dreo.dnd.ca>
List: netbsd-help
Date: 06/11/2001 11:27:48
Luke,

Thanks for a quick answer. My apologies for leaving out the platform
info. It is NetBSD 1.5 on i386.

How is lldiv? Is support for long long widespread?

On Tue, 12 Jun 2001, Luke Mewburn wrote:
> On Mon, Jun 11, 2001 at 11:10:13AM -0400, Claude Marinier wrote:
> > Hi,
> >
> > I would like to use ldiv but it does give me the result I expect. I have
> > reduced the problem to the following code. This produces the correct
> > result on Alpha/VMS with the DEC (Compaq) compiler and on SPARC64/Solaris
> > with the Sun and gcc 2.95.2 compilers. I do 'cc -o test-ldiv test-ldiv.c'
> > with no other switches. What am I missing? Thanks.
> >
> > #include <stdio.h>
> > #include <stdlib.h>
> >
> > void main( void )
> > {
> > 	long i, j;
> > 	ldiv_t result;
> >
> > 	printf( "Test ldiv\n\n" );
> >
> > 	i = 25;  j = 6;
> > 	result = ldiv( i, j );
> > 	printf( "  dividing %d by %d\n", i, j );
> >
> > 	printf ( "  quotient is %d, and remainder is %d\n",
> > 		result.quot, result.rem );
> >
> > 	return;
> > }
>
> On which NetBSD platform and release?
>
> There is a known problem with ldiv(3) on NetBSD/i386 in the 1.5
> release. (I discovered it whilst trying to debug a third-party
> package). It has been fixed -current. I believe the fix was
> pulled up to the netbsd-1-5 CVS branch, and if that's the case,
> NetBSD 1.5.1 will have the fix.

-- 
Claude Marinier, Information Technology Group    claude.marinier@dreo.dnd.ca
Defence Research Establishment Ottawa (DREO)    (613) 998-4901  FAX 998-2675
3701 Carling Avenue, Ottawa, Ontario  K1A 0Z4         http://www.dreo.dnd.ca