use truncate for integer (ISO standard, obs from Paulo Moura).
This commit is contained in:
parent
6f745469b0
commit
9f098a0297
@ -944,7 +944,7 @@ ord_list_to_rbtree(List, t(Nil,Tree)) :-
|
|||||||
Nil = black('', _, _, ''),
|
Nil = black('', _, _, ''),
|
||||||
Ar =.. [seq|List],
|
Ar =.. [seq|List],
|
||||||
functor(Ar,_,L),
|
functor(Ar,_,L),
|
||||||
Height is integer(log(L)/log(2)),
|
Height is truncate(log(L)/log(2)),
|
||||||
construct_rbtree(1, L, Ar, Height, Nil, Tree).
|
construct_rbtree(1, L, Ar, Height, Nil, Tree).
|
||||||
|
|
||||||
construct_rbtree(L, M, _, _, Nil, Nil) :- M < L, !.
|
construct_rbtree(L, M, _, _, Nil, Nil) :- M < L, !.
|
||||||
|
Reference in New Issue
Block a user