On 12.06.2018 23:12, Klaus Hartnegg wrote:
writeln (round(a*1.1));
As with usual float formats 1.1 can't be represented exactly, the result
can't be considered any precise value.
-Michael
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.o
On 12.06.2018 23:12, Klaus Hartnegg wrote:
No, it does not depend on the hardware, but on the setting of $N.
Turbo Pascal with $N+ rounds like FreePascal. But the default is $N-.
In this mode Turbo Pascal always rounds up.
What exactly does $N in Turbo pascal mean ? Obviously it in this case
On 12.06.2018 23:12, Klaus Hartnegg wrote:
The only *reliable* solution appears to be compiling a modified
version of FreePascal.
It would make the round function a lot slower not to simply rely on the
hardware.
And in fact the only *reliable* solution is *not ever* to rely on exact
values
Am 13.06.2018 um 22:19 schrieb Marco van de Voort:
In our previous episode, Florian Kl?mpfl said:
In our previous episode, Sven Barth via fpc-pascal said:
Which is what FPC already provides with SetRoundMode() in unit Math.
As long as one changes the rounding mode only locally for some calcula
In our previous episode, Florian Kl?mpfl said:
> > In our previous episode, Sven Barth via fpc-pascal said:
> >> Which is what FPC already provides with SetRoundMode() in unit Math.
> >>
> >> As long as one changes the rounding mode only locally for some calculations
> >> and restores it afterwards
Am 13. Juni 2018 5:39:08 nachm. schrieb mar...@stack.nl (Marco van de Voort):
> In our previous episode, Sven Barth via fpc-pascal said:
>> Which is what FPC already provides with SetRoundMode() in unit Math.
>>
>> As long as one changes the rounding mode only locally for some calculations
>> an
In our previous episode, Sven Barth via fpc-pascal said:
> Which is what FPC already provides with SetRoundMode() in unit Math.
>
> As long as one changes the rounding mode only locally for some calculations
> and restores it afterwards there should be no problem (the rounding mode
> can be consid
El 12/06/2018 a las 23:12, Klaus Hartnegg escribió:
Am 11.06.2018 um 10:01 schrieb Michael Schnell:
- the way of rounding is defined by the CPU hardware, even old Turbo
Pascal executables do banker's rouding on modern hardware.
No, it does not depend on the hardware, but on the setting of $N.
Wolf schrieb am Mi., 13. Juni 2018, 09:27:
> Why not ask the CPU to do the rounding? This is what Intel offers in
> volume 1 of the Intel ® 64 and IA-32 Architectures Software Developer's
> Manual:
> 4.8.4.1
> Rounding Control (RC) Fields
> In the Intel 64 and IA-32 architectures, the rounding m
Why not ask the CPU to do the rounding? This is what Intel offers in
volume 1 of the Intel ® 64 and IA-32 Architectures Software Developer's
Manual:
4.8.4.1
Rounding Control (RC) Fields
In the Intel 64 and IA-32 architectures, the rounding mode is controlled
by a 2-bit rounding-control (RC)
On 12.06.2018 09:01, Mattias Gaertner wrote:
Floats can represent 1.5 exactly.
Of course I do know how the binary representation of floats is done on
X86 and similar architectures, and hence that same provides a bit
combination that exactly defines 1.5.
That is why I did say *relying* on the
11 matches
Mail list logo