[PATCH] support timeout with seconds in float

1 view
Skip to first unread message

Qian Yun

unread,
Jul 17, 2026, 7:31:29 AM (yesterday) Jul 17
to fricas-devel
Because why not?

- Qian

diff --git a/src/algebra/timeout.spad b/src/algebra/timeout.spad
index f200fa62..0957c99c 100644
--- a/src/algebra/timeout.spad
+++ b/src/algebra/timeout.spad
@@ -3,7 +3,7 @@
++ Description:
++ This package supports evaluation with timeout.
TimeoutPackage(S : Type) : with
- eval_with_timeout : (() -> S, Integer) -> Union(S, "failed")
+ eval_with_timeout : (() -> S, DoubleFloat) -> Union(S, "failed")
++ eval_with_timeout(f, t) calls \spad{f} with timeout of
++ \spad{t} seconds. Returns value computed by \spad{f}
++ or "failed" if \spad{f} did not finish within \spad{t}

Waldek Hebisch

unread,
Jul 17, 2026, 10:21:14 AM (23 hours ago) Jul 17
to fricas...@googlegroups.com
On Fri, Jul 17, 2026 at 07:31:24PM +0800, Qian Yun wrote:
> Because why not?

Well, for time calculation I defintely prefer integers. Why:
- to avoid possible paradoxes due to rounding
- with reasonable units and time scale we can use fixnums
which is non-consing. Doubles need memory allocation
which may interfere with precise timing

In case of timeout both reasons are not very important, but
I still prefer integers for consistency.
> --
> You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/fricas-devel/8e1d507e-5bb8-4f8b-8795-7f04b118e53a%40gmail.com.

--
Waldek Hebisch
Reply all
Reply to author
Forward
0 new messages