[fpc-pascal] Re: Why this evaluates on "if" wrong ? (GMP)
inga at tlu.ee
Tue Oct 30 17:31:08 CET 2007
A copy-paste from Python Shell:
>>> a = 1
>>> a = a + 0.4
>>> a = a - 0.4
>>> a == 1
PS I always talk to my informatics-students: You never-ever do with
real-variables something like this: if real1 = real2 then ...
Real numbers can be equal with some precision.
On Tue, 30 Oct 2007, Andrea Mauri wrote:
> But someone tried to reproduce the example with other programming languages?
> mm ha scritto:
>> Tom Verhoeff a écrit :
>>> In fact, the GMP (GNU Multiple Precision Arithmetic Library <gmplib.org>)
>>> offers this and more. Unfortunately, there does not seem to be a complete
>>> FreePascal interface for it. Maybe it is easy to adapt (if necessary?)
>>> the GNU Pascal interface for GMP <http://www.gnu-pascal.de/gpc/GMP.html>.
>>> I would be interested.
>> But there are multi-precision libraries for Free Pascal.
>> The one I am writing:
>> "NX" (big integers, big reals, big complexes, big polynomials
>> over GF(2)) at
>> An other one:
>> "MPINT" (big integers, big rationals) at
>> And there are others.
>> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
More information about the fpc-pascal