REBOL 3.0

How many decimal-digits?

Carl Sassenrath, CTO
REBOL Technologies
9-Aug-2007 0:04 GMT

Article #0096
Main page || Index || Prior Article [0095] || Next Article [0097] || 1 Comments || Send feedback

Our friend Geomol has been testing the 64bit decimal capabilities of R3. Specifically, he is looking at the decimal-digits default, which is set to 15 digits (because that's what clib specifies).

He uses this test:

>> d: 3 loop 16 [print 1.9 * d d: d * 10 + 3]
5.7
62.7
632.7
6332.7
63332.7
633332.7
6333332.7
63333332.7
633333332.7
6333333332.7
63333333332.7
633333333332.7
6333333333332.7
63333333333332.7
633333333333333.0
6.33333333333333E+15
== 33333333333333333

And he asks:

Is 15 digits always ok? Can anyone come up with a test, which shows, that 15 digits give bad results for some calculation?

So, there's a question for you. Know the answer?

1 Comments

REBOL 3.0
Updated 23-Apr-2024 - Edit - Copyright REBOL Technologies - REBOL.net