[Aldor-l] bug in documentation of the function length from IntegerType

Ralf Hemmecke ralf at hemmecke.de
Wed Jun 22 07:27:00 EDT 2005


There is a bug in the documentation of the function length from IntegerType.

Cite from lib/aldor/src/arith/sal_intcat.as

		length: % -> Z;
#if ALDOC
\alpage{length}
\Usage{\name~a}
\Signature{\%}{\altype{MachineInteger}}
\Params{ {\em a} & \% & an integer\\ }
\Retval{Returns the number of binary bits of a, \ie n such that
\alexp{bit?}$(a, n-1)$ is \true and \alexp{bit?}$(a, m)$
is \false for $m \ge n$.}
#endif

For the above output description to be valid, one must restrict to a>=0.
There should be some statement about negative numbers. Who knows more 
about the internals?

Ralf

Just try

aldor -gloop
#include "aldor"
#include "aldorinterp"
import from MachineInteger
length(-5); -- returns 3
bit?(-5, 3); -- returns true as I would expect





More information about the Aldor-l mailing list