div() & ldiv() behavior?

Steve Emmerson steve at unidata.ucar.edu
Wed Apr 10 23:39:00 AEST 1991


Hi,

Would someone who knows please tell me the behavior of div() and ldiv()?

My POSIX book says nothing, and my K&R2 only states that they return
the quotient and remainder of the `numer' and `denom' arguments in the
`quot' and `rem' members of their associated structure types.

I know what this means when both arguments are positive, but I'm uncertain
what this means for the other three cases.  I you would tell me, I would
appreciate it.

Thanks in advance.

Steve Emmerson        steve at unidata.ucar.edu        ...!ncar!unidata!steve



More information about the Comp.std.c mailing list