D. Allen [CGL]" <idallen@watcgl.waterloo.edu> (03/02/91)
The Ultrix 4.x rint man page:
Syntax
#include <math.h>
[...]
double rint(x)
double x;
The program:
#include <math.h>
main()
{
double x = rint(0.0);
printf("%f\n",x);
return(0);
}
The output: 4.000000
The lint ("lint i.c -lm"):
name declared but never used or defined
matherr i.c?(147)
value type used inconsistently
rint llib-lm(63) :: i.c(4)
value type declared inconsistently
rint llib-lm(63) :: i.c(4)
function returns value which is always ignored
printf
The problem -- no "extern double rint();" in math.h:
% grep -w rint /usr/include/*.h
%
The declaration for trunc() is missing; floor() is there but ffloor()
is not; there may be others missing. The indication to use <math.h>
in the man page is wrong and misleading, since you still have to
declare many of the functions.
Anyone want to type all this onto an SPR form to DEC?
--
-IAN! (Ian! D. Allen) idallen@watcgl.uwaterloo.ca idallen@watcgl.waterloo.edu
[129.97.128.64] Computer Graphics Lab/University of Waterloo/Ontario/Canada