World: r3wp
[!REBOL3-OLD1]
older newer | first last |
PatrickP61 15-Aug-2007 [4112] | REBOL/View 1.3.2.3.1 5-Dec-2005 Core 2.6.3 Copyright 2000-2005 REBOL Technologies. All rights reserved. REBOL is a trademark of REBOL Technologies. WWW.REBOL.COM >> x: 1.0 while [(1.0 + (x / 2.0)) > 1.0] [x: x / 2.0] == 1.77635683940025E-15 Microsoft Windows XP Home Edition Version 2002 Service Pack 2 Compaq Presario AMD Athlon XP 2200+ 1.80 GHz 1.00 GB of RAMS |
Louis 15-Aug-2007 [4113] | James, not sure yet. Probably not, as I need unicode support. |
Sunanda 16-Aug-2007 [4114x2] | REBOL/Core 2.5.6.3.1 / win XP / AMD-TL50 3.5527136788005E-15 |
REBOL/View 1.3.1.3.1 17-Jun-2005 Core 2.6.0 -- same op sys and machine as above: 1.77635683940025E-15 | |
sqlab 16-Aug-2007 [4116] | Windows XP Pro, Prozessor x86 Family 15 Model 2 Stepping 9 GenuineIntel ~2807 Mhz REBOL/Command 2.6.2.3.1 1.77635683940025E-15 REBOL/Pro 2.6.2.3.1 1.77635683940025E-15 REBOL/Core 2.6.0.3.1 1.77635683940025E-15 REBOL/Pro 2.5.125.3.1 1.77635683940025E-15 REBOL/Core 2.5.0.3.1 3.5527136788005E-15 REBOL/Pro 2.5.8.3.1 8.88178419700125E-16 REBOL/Core 2.3.0.3.1 false REBOL/Core 2.2.7.3.1 false |
Ladislav 16-Aug-2007 [4117x4] | Geomol: you discovered "rounded equality", unfortunately, there were some adjustments to it recently (some made by mistake, some intentional) |
have you got any reasons why to prefer same? 1 1.0 == true or same? 1 1.0 == false? | |
(question is for any rebol user and mainly for Rebol, i.e. the future) | |
...for Rebol3... is what I wanted to mention above | |
Geomol 17-Aug-2007 [4121x2] | Okay, I don't think, I need more tests on my little routine. The 8.88.....E-16 result from sqlab was interesting! :-) Else all other results were 1.77....E-15 and 3.55.....E-15. Ladislav, I think, I understand the situation and the problem now. That's why I made this investigation. There is another way to handle this, where it's up to the programmer, which of the two situations same? 1 1.0 == true or same? 1 1.0 == false? should hold. See my large post in the "Bugs" group in "R3-Alpha" world. Thanks to everyone doing the test! |
A little update from Alpha testing. Since last time, this happened: - POWER can now handle negative number and exponent - Some bugs fixed regarding: money!, path, VID crash, change/part, read, function and closure recursion crash, compose/deep - New dictionary! datatype (replacing hash!) - A lot is going on in the graphics, VID and DRAW groups - Ongoing work to get the test methods to perfection We're now on Alpha 49. | |
Pekr 17-Aug-2007 [4123x2] | Carl asks about better name for dictionary!, which is a bit long. I think there is only one alternative, if we want the name to be on pair with other languages - dict! ... the thing is, that we don't use abbreviations in REBOL most of the time, but we have func too, so why not dict! ? |
and I don't like percents. I don't want to open that discussion here, because I already seen some discussion on it, and while it might seem trivial, it is not :-) But generally I refuse result which is different from what I got from calculator. So basically how following could be valid escapes my basic school knowledge: 12.3 * 110% = 13.4 Of course I would expect 12.3 + (10% from the base (12.3)) = 13.53, which is returned also by my Windows calculator. Even if I think about 110% as of 1.1, still 12.3 * 1.1 = 13.53. IMO there is a bug in the doc :-) | |
Rebolek 17-Aug-2007 [4125x2] | that's a docs problem, let me fix it... r3 works as your calculator, Pekr :) >> 12.3 * 110% == 13.53 |
Also remember that main purpose of percent is to enhance sematics in dialects and not to work as a calculator. But you're free to write your own calculator dialect. | |
Pekr 19-Aug-2007 [4127x3] | I just read about BCD representation and money datatype. What escapes my understanding is, why BCD is internally tied to just money area? I really don't like it. |
Coulldn't I just choose some mode for decimal datatype to work as BCD? | |
E.g. - just recently in one of our systems we tried to solve weigh unit conversions, where we needed precision on milligrams. If my understanding is correct, it is where I should use money. Now how is $ unit usefull for me here? | |
Sunanda 19-Aug-2007 [4130] | Maybe best to think of the $ as a BCD specifer rather than specifically a money one. to-bcd: : to-money for all other uses :-) |
Pekr 19-Aug-2007 [4131x2] | yes, I would come up with some new name. My question is - did anyone use money? I never used it in my scripts for e.g. |
just recently dictionary! datatype was renamed to map! datatype ... | |
PeterWood 19-Aug-2007 [4133] | Using $ as a BCD specifier wouldn't be so bad if 'print ignored it. >>print join weight ["mg"] == $123.45678mg |
Pekr 19-Aug-2007 [4134] | some time ago we thought about allowing other chars for money. Or something like USD$123.123 ... the question is, if there is some better char to be used for amount of various units? |
Sunanda 19-Aug-2007 [4135] | $123.45678mg .... That is a drawback, Peter. Will format help? And it may still be negotiable in R3: http://www.rebol.net/r3blogs/0092.html |
Pekr 19-Aug-2007 [4136x3] | format is not enough. I don't know why we have datatype limited to money? Why not kg, tonnes, other units? |
the trouble is, how to make such datatype look like in rebol, and not complicate low level parser | |
we have already #[none] form etc., so maybe [kg]1234.5678, or 1234.5678[kg] :-) | |
Geomol 19-Aug-2007 [4139x2] | With 64-bit decimals, you have 15 digits precision, and it's faster. You can specify up to a million ton, and still have milligrams. Is that enough for your task? |
Example: 123'456'789.123'465 is a valid decimal! with full precision. | |
Pekr 19-Aug-2007 [4141] | Geomol - yes, it is. And is it guaranteed that the last digits will be always precise? |
Geomol 19-Aug-2007 [4142x4] | That's one of the things, I'm investigating for the alpha-release. If all your numbers are within that limit, it should be ok. But if you e.g. add 2 numbers like: 123'456'789'012'345.0 + 123'456'789.012'345, you loose presicion in the smaller number. |
The precision for 64-bit IEEE decimals is 15.95 decimal digits. You can have results up to 17 digits (it's a parameter to be able to change). It's default set to 15 to always give correct result. In 5% of the cases, the 16th digit will be wrong. See e.g.: http://babbage.cs.qc.edu/courses/cs341/IEEE-754references.html | |
Work is done to get around problems like: >> (0.2 - 0.1) = 0.1 == true >> (1.2 - 1.1) = 0.1 == false (This is also a the results in R2.) | |
And in other languages like C btw. | |
Pekr 19-Aug-2007 [4146x2] | well, look - we've got BCD for the money, right? so there is the solution for those who need it. But i would vote for another kind of expressing units, more general. IMO money! is the most useless datatype in REBOL. My proposition really is 123'456.123[unit], where 'unit would be of no meaning to not complicate things - simply 123[USD] + 123[EUR] would be 246[USD] - the first occurance of the unit. |
I can even imagine unit conversion table, so that we could get even USD + EUR result .... and if expression would contain some non transferrable units, e.g. USD + kg, then error would be raised ... | |
Geomol 19-Aug-2007 [4148] | Write that down somewhere (other than only here). When the DocBase go public, there could be a place there for new ideas and suggestions. |
Gabriele 19-Aug-2007 [4149x6] | [...] can't be done |
kg$123 is not that bad - other languages have much weirder syntax. | |
maybe, we can do 123#kg but i don't see a big improvement here. | |
kg#123 may be possible too. | |
or 123$kg | |
rebol has very few "special" characters. so you'd have to pick between # $ %. | |
Pekr 19-Aug-2007 [4155] | or we just could state, that $ is simply a unit char. And rename datatype from money! to unit! :-) |
Gabriele 19-Aug-2007 [4156x6] | % is already used by percent! is is out of the question. |
R2: | |
>> kg$100 == KG$100.00 | |
so, yes, it's already that wa. | |
way. | |
maybe 123kg can be made to work, but, i don't know if it would create problems. | |
older newer | first last |