1. double precision reals??

Hi all,
How can I make sure that a variable is always of type "double precision" ?
If I make it an atom, it 'could' be a double precision real, but if the
range of the number is small enough, Euphoria turns it into a single
precision real, is it not?
For instance, the double precision number 5.123456789012345678e4 can be
represented by a single precision real but with less accuracy namely
something like this: 5.123456789e4. I believe that Euphoria automatically
turns my double precision atom into a single precision atom when it has the
chance. Is this correct and how can I 'force' Euphoria to always regard my
variable as a double precision value???
Is this asking too much of Euphoria?

Eddy

new topic     » topic index » view message » categorize

2. Re: double precision reals??

> Hi all,
> How can I make sure that a variable is always of type "double precision" ?
> If I make it an atom, it 'could' be a double precision real, but if the
> range of the number is small enough, Euphoria turns it into a single
> precision real, is it not?
> For instance, the double precision number 5.123456789012345678e4 can be
> represented by a single precision real but with less accuracy namely
> something like this: 5.123456789e4. I believe that Euphoria automatically
> turns my double precision atom into a single precision atom when it has the
> chance. Is this correct and how can I 'force' Euphoria to always regard my
> variable as a double precision value???
> Is this asking too much of Euphoria?
>
> Eddy

Hi,
That shouldn't be possible, euphoria hides its internal implementation
from the programer.

Thomas Parslow (PatRat) ICQ #:26359483
Rat Software
http://www.rat-software.com/
Please leave quoted text in place when replying

new topic     » goto parent     » topic index » view message » categorize

3. Re: double precision reals??

Eddy Van Esch wrote:
>
> Hi all,
> How can I make sure that a variable is always of type "double precision" ?
> If I make it an atom, it 'could' be a double precision real, but if the
> range of the number is small enough, Euphoria turns it into a single
> precision real, is it not?
> For instance, the double precision number 5.123456789012345678e4 can be
> represented by a single precision real but with less accuracy namely
> something like this: 5.123456789e4. I believe that Euphoria automatically
> turns my double precision atom into a single precision atom when it has the
> chance. Is this correct and how can I 'force' Euphoria to always regard my
> variable as a double precision value???
> Is this asking too much of Euphoria?
>
> Eddy

Hi,
there are NO single precisions in EU. There are only integers (32 bit)
or double precisions. Never will be a loss of accuracy within 15 digits.
Read 2.1.1 of the reference manual.

Rolf

new topic     » goto parent     » topic index » view message » categorize

4. Re: double precision reals??

Rolf Schroeder wrote:
> ......   There are only integers (32 bit) ...

Of course integers in Eu have 31 bit.

Rolf

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu