[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Unexpected calculation result with Lua53
- From: Alex Queiroz <asandroq@...>
- Date: Mon, 4 May 2015 11:46:12 +0200
Hello,
On 4 May 2015 at 10:45, Dirk Laurie <dirk.laurie@gmail.com> wrote:
>
> Lua 5.3, for better or words, has a syntactic convention that "1" is
> an exact integer whereas "1." is a (by coincidence exact) approximation
> to it. In Lua 5.3, when approximations are preferred one should always
> code "1.", and in a situation where exactness is needed, one should
> always code "1". Even computer users who are not computer scientists
> can surely be trained to do that. Heck, even some pure mathematicians
> have been known to grasp this point.
>
Time for a quick Scheme REPL:
===============
11:38 $ gsi
Gambit v4.7.5
> (exact? 1)
#t
> (exact? 1.)
#f
===============
The different obviously being that Scheme exact numbers are unbounded.
Cheers,
--
-alex
http://unendli.ch/