Thrown an error if T < 0 or T > 0xfffffffffffffbff in sleep(T)

This commit is contained in:
notoria
2020-04-19 22:43:13 +02:00
parent 5a063c541d
commit fb331d39a6

View File

@@ -16,7 +16,12 @@
sleep(T) :- sleep(T) :-
builtins:must_be_number(T, sleep), builtins:must_be_number(T, sleep),
'$sleep'(T). ( T < 0 ->
throw(domain_error(not_less_than_zero, T))
; T > 0xfffffffffffffbff ->
throw(domain_error(not_great_than_0xfffffffffffffbff, T))
; '$sleep'(T)
).
time(Goal) :- time(Goal) :-
'$cpu_now'(T0), '$cpu_now'(T0),