REBOL3 tracker
  0.9.12 beta
Ticket #0001475 User: anonymous

Project:



rss
TypeBug Statustested Date7-Feb-2010 23:14
Versionalpha 97 CategoryDatatype Submitted bySunanda
PlatformAll Severityminor Prioritynormal

Summary Large percentages not serializable
Description x: 30000000000000000000000000000000000%
== 3e34%

No obvious way to mold and restore this value:

do mold/all x
** Syntax error: invalid "decimal" -- "3.0000000000000003e34%"

do mold x
** Syntax error: invalid "decimal" -- "3e34%"

load mold x
** Syntax error: invalid "decimal" -- "3e34%"

load mold/all x
** Syntax error: invalid "decimal" -- "3.0000000000000003e34%"


****

Slightly smaller values go wrong with a different rounding:

x: 3000000000000000000000000000000%
== 3e30%

>> do mold/all x
** Syntax error: invalid "decimal" -- "2.9999999999999997e30%"
Example code
load "3e34%"

or
x: 30000000000000000000000000000000000%
do mold/all x

Assigned ton/a Fixed inalpha 108 Last Update3-Nov-2010 07:08


Comments
(0002052)
BrianH
1-Mar-2010 23:24

See also #1504.

The issue here is either in MOLD or LOAD. MOLD is generating scientific notation for certain percent! values, and LOAD isn't recognizing that scientific notation. So either MOLD needs to be changed to not generate that syntax, or LOAD changed to recognize it.
(0002081)
Ladislav
9-Mar-2010 10:58

The variant for MOLD to not generate that syntax is not an option, at least for some values. Since the PERCENT! datatype has the range of the 64-bit IEEE754 floating point values, the limitation of it looks higly impractical, so we should live with the given range. That means that MOLD has to mold all values in the range as well as that LOAD has to accept them too.
(0002770)
Ladislav
3-Nov-2010 07:07

in the core-tests suite
(0002771)
Ladislav
3-Nov-2010 07:08

should be reopened, the tests:

#r3only
; 64-bit IEEE 754 maximum
; bug#1475
[same? 1.7976931348623157e310% load mold/all 1.7976931348623157e310%]
#r3only
; bug#1475
; 64-bit IEEE 754 minimum
[same? -1.7976931348623157E310% load mold/all -1.7976931348623157e310%]

still fail

Date User Field Action Change
18-Aug-2013 14:14 Ladislav Comment : 0002081 Modified -
3-Nov-2010 07:08 Ladislav Comment : 0002771 Added -
3-Nov-2010 07:07 Ladislav Comment : 0002770 Added -
20-Oct-2010 03:08 BrianH Status Modified built => tested
22-Sep-2010 05:25 carl Fixedin Modified => alpha 108
22-Sep-2010 05:25 carl Status Modified submitted => built
9-Mar-2010 10:58 Ladislav Comment : 0002081 Added -
1-Mar-2010 23:24 BrianH Comment : 0002052 Added -
8-Feb-2010 04:07 BrianH Summary Modified Large percentages nor serializable => Large percentages not serializable
8-Feb-2010 04:07 BrianH Description Modified -
8-Feb-2010 04:07 BrianH Code Modified -
7-Feb-2010 23:14 sunanda Ticket Added -