Subject: Re: ldiv problem
To: Peter Seebach <seebs@plethora.net>
From: Mike Cheponis <mac@Wireless.Com>
List: netbsd-help
Date: 06/11/2001 10:50:38
FWIW:
#include <stdio.h>
#include <stdlib.h>
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 0;
}
produces:
Test ldiv
dividing 25 by 6
quotient is 4, and remainder is 1
$ uname -a
NetBSD S 1.5.1_BETA NetBSD 1.5.1_BETA (GENERIC) #31: Fri Apr 6 13:39:46 CEST 2001 he@nsa.uninett.no:/usr/src/sys/arch/i386/compile/GENERIC i386
-Mike
On Mon, 11 Jun 2001, Peter Seebach wrote:
>
> ...
> If you're getting large negative numbers, me too!
>
> -s