r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Core] Discuss core issues

Andreas
14-Jul-2010
[17491]
Linux
Ladislav
14-Jul-2010
[17492]
Brian, I would correct this "bug", if I were able to
BrianH
14-Jul-2010
[17493]
I'll check CureCode to see if the bug is already there.
Ladislav
14-Jul-2010
[17494]
the problem is, that Microsoft does not allow me to do what I want 
in Windows
Andreas
14-Jul-2010
[17495]
Btw, I consider my implementation to be far more correct than yours.
Ladislav
14-Jul-2010
[17496x2]
No need to put it to CC, the code that generates the string was written 
by me (both for Linux and for Windows), and I did my best
Linux yields a "better value", since I had more freedom in coding 
the conversion
Andreas
14-Jul-2010
[17498]
0.10000000000000001 is not discernible from 0.1 in double precision 
IEEE754. 0.10000000000000002 is, though.
BrianH
14-Jul-2010
[17499]
The behavior as designed in R3 is this:
>> mold 0.1
== "0.1"
>> mold/all 0.1
== "0.10000000000000001"

This is because 0.1 is not directly representable in a IEEE754 value. 
If it does not work this way on a platform, then the platform code 
is broken. And you, Ladislav, were the one who made the rule in the 
first place.
Andreas
14-Jul-2010
[17500]
If that is intended behaviour for R3, then R3 is broken (or designed 
to use single-precision floating point).
Steeve
14-Jul-2010
[17501]
Wow, that'"s a direct attack :-)
Andreas
14-Jul-2010
[17502]
Well, I take that back.
Ladislav
14-Jul-2010
[17503x2]
Neither 0.10000000000000001, nor  0.1 violate IEEE754 norm
(as Andreas found out)
BrianH
14-Jul-2010
[17505]
Andreas, it is the latter. The decimal! type is designed to use single-precision 
floating point. And that behavior is in the standard (according to 
Ladislav, the last time this discussion came up a year ago or so). 
I told you the decimal! type was misnamed.
Andreas
14-Jul-2010
[17506x2]
0.1 and 0.10000000000000001 are represented differently in single-precision 
IEEE754.
Well, forget it.
Ladislav
14-Jul-2010
[17508]
You mean double precision, I suppose?
Andreas
14-Jul-2010
[17509]
I am mainly about how to regain a decimal representation from IEEE754 
encoding.
Ladislav
14-Jul-2010
[17510]
(i.e. 64-bit)?
BrianH
14-Jul-2010
[17511x2]
Or double, whatever. But the current behavior was argued for by Ladislav, 
and is consistent with all other IEEE754 implementations, according 
to the standard. Ladislav, if that behavior doesn't match what the 
standard says, and what you requested, then it needs reporting.
Or we can reopen your ticket.
Ladislav
14-Jul-2010
[17513]
It matches the standard
Andreas
14-Jul-2010
[17514x2]
Brian, have you read IEEE754 or are you otherwise intimately familiar 
with it?
But more directly: _both_ behaviours match the standard.
Ladislav
14-Jul-2010
[17516x2]
The standard is, that every result shall be rounded "to the nearest 
representable number"
And, "the nearest representable number" to 0.1 and 0.10000000000000001 
is the same
BrianH
14-Jul-2010
[17518]
Which matches the standard? Andreas's demonstrated behavior on Linux, 
or mine on Windows? Because they need to behave exactly the same. 
If they don't, one of the platforms has a platform-specific bug. 
Pick one.
Andreas
14-Jul-2010
[17519x3]
Depends on what you consider the nearest representable number to 
be :)
And what FP precision you use in the process.
0.1 is 3DCCCCCD in single-precision, which is 9.9999994e-2 when converted 
to decimal representation without rounding.
Ladislav
14-Jul-2010
[17522x2]
Representable numbers
 are described in http://www.rebol.net/wiki/Decimals-64
http://www.rebol.net/wiki/Decimals-64#IEEE_754_Standard
BrianH
14-Jul-2010
[17524]
I don't consider anything. Ladislav read the standards, and as an 
expert he set the rules. I am refering to what he said when he did 
so, and my experience with other languages that use IEEE754. The 
behavior needs to be exactly consistent on Windows and Linux. If 
they don't match, one of them is wrong. Pick one.
Andreas
14-Jul-2010
[17525]
When using double precision, the current Windows behaviour is wrong. 
For now, this is just my opinion, as I seem to remember round-to-nearest 
is a single precision thing, but I'll have to re-read the standard 
for that.
BrianH
14-Jul-2010
[17526]
And this is not a matter of Linux's or Windows' behavior, it is a 
matter of REBOL's behavior.
Andreas
14-Jul-2010
[17527]
the behaviour of the current implementation of REBOL 3 for Windows
 -- satisfied?
BrianH
14-Jul-2010
[17528]
No. MOLD is not supposed to be a platform-specific function. All 
platform-specific behavior is a bug.
Ladislav
14-Jul-2010
[17529x2]
Well, Linux is better, and I *could* get the same behaviour if using 
gcc in Windows, but not if using microsoft compiler...
So, OK, it is a bug of MS compiler, which I cannot work-around in 
any reasonable way
Andreas
14-Jul-2010
[17531x2]
Brian: do you in fact read what I write? Or just single our words 
to pick on?
When using double precision, the behaviour of the current implementation 
of REBOL 3 for Windows is wrong.
 -- Do I imply anywhere in this sentence that this is not a bug?
BrianH
14-Jul-2010
[17533]
I read it. I was saying that *as a hard rule* platform-specific behavior 
is reserved for only a few functions in R3. For other functions it 
is a bug. I'm not satisfied until that bug is at least reported. 
Am I clear now?
Andreas
14-Jul-2010
[17534]
Feel free to report it.
Ladislav
14-Jul-2010
[17535]
Nobody will correct it, though, since it is generated by the MS compiler
BrianH
14-Jul-2010
[17536x2]
Andreas, I am not qualified to do so. I haven't read the standard, 
don't know the code involved, and don't run Linux.
Ladislav, why can't you write your own formatter, or use a consistent 
third-party one? At least when you detect a known error during config?
Andreas
14-Jul-2010
[17538]
Brian, you are perfectly qualified. mold/all 0.1 on Windows differs 
from mold/all 0.1 on Linux. If you are only satisfied when this is 
reported as bug, feel free to report it.
BrianH
14-Jul-2010
[17539]
But I can't say which is the buggy one.
Ladislav
14-Jul-2010
[17540]
Ladislav, why can't you write your own formatter
 - I can do so in GCC, but not in MS C, sorry