[erlang-questions] Fwd: max timeout
Bjorn Gustavsson
bgustavsson@REDACTED
Thu Aug 21 05:45:49 CEST 2008
I forgot to send the email to the mailing list...
---------- Forwarded message ----------
From: Bjorn Gustavsson <bgustavsson@REDACTED>
Date: Thu, Aug 21, 2008 at 5:33 AM
Subject: Re: [erlang-questions] max timeout
To: Serge Aleynikov <saleyn@REDACTED>
On Wed, Aug 20, 2008 at 12:38 PM, Serge Aleynikov <saleyn@REDACTED> wrote:
> So, does this mean that #1 below is indeed the right answer and that
> 'receve after' implementation correctly deals with bignums between 2^27 and
> 2^32?
>
No, #2 is the correct answer.
>
> 1. 2^32 (this is what's documented, but only seems to work in the shell)
>
Documented where? Note that 2^32 does NOT fit in 32 bits (it is a one
followed by 32 zeroes; i.e. 33 bits).
2^32 does not work in the shell for me:
1> receive after (1 bsl 32) -> ok end.
** exception error: bad receive timeout value
> 2. 2^32-1 = 49.5 days
>
Yes, 2^32-1 is equal to 16#ffffFFFF, which is what Reference manual says.
16#ffffFFFF is that largest number that
can fit in 32 bits.
>
> 3. Erlang's small integers (2^27-1 = 1.5 days)
>
There used to be such limitation, a long time ago.
/Bjorn
>
> --
Björn Gustavsson, Erlang/OTP, Ericsson AB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080821/770df54e/attachment.htm>
More information about the erlang-questions
mailing list