BOOTSTRAP (klibm) functions


LIBRARY ROUTINE

kdata_arith2_ubyte - perform 2-input unsigned byte arithmetic

LIBRARY CALL

void kdata_arith2_ubyte(
   int           mode,
   int           numpts,
   unsigned char *data1,
   unsigned char *data2,
   unsigned char *mask1,
   unsigned char *mask2 )

INPUT

OUTPUT

RETURN VALUE

nothing

DESCRIPTION

This function performs the operation defined by "mode" using data in array "data1" as the first operand, and data in array "data2" as the second operand. Valid operations are KADD, KSUB, KSUBFROM, KMULT, KDIV, KDIVINTO, KABSDIFF, KMODULO, KMINIMUM, and KMAXIMUM.

This function assumes that both input arrays, data1 and data2, are valid, and that if either mask1 or mask2 is passed in, then both masks have been passed in.

Potential division by zero is checked, and the maximum unsigned byte (255) returned instead.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

None

RESTRICTIONS

none

MODIFICATION

May 2 1994 - Removed gating input option. Added functionality for KSUBFROM and KDIVINTO cases. Feb 14 1995 - Changed name from karith2_ubyte to kdata_arith2_ubyte, moved to BOOTSTRAP::kmath, and changed status from private to public.

FILES

$BOOTSTRAP/objects/library/klibm/src/kdata_arith2.c

SEE ALSO

klibm(3)

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.