1. Largest/smallest atom

While I know they are about +/- 1e308, is there some way to specify the largest/smallest atom such as float64_to_atom(#FF,#FF,...})??

jemima

new topic     » topic index » view message » categorize

2. Re: Largest/smallest atom

jemima said...

While I know they are about +/- 1e308, is there some way to specify the largest/smallest atom such as float64_to_atom(#FF,#FF,...})??

jemima:

Your question is not too clear but I think I understand what your asking.

You can use a user define type to test for a upper and lower limit.

See user define type in the reference document.

Bernie

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

3. Re: Largest/smallest atom

jemima said...

While I know they are about +/- 1e308, is there some way to specify the largest/smallest atom such as float64_to_atom(#FF,#FF,...})??

These are the largest and smallest magnitude atoms (and their float64 representations):

    1.7976931348623157e+308 {255,255,255,255,255,255,239,127} 
    4.9406564584124654e-324 {1,0,0,0,0,0,0,0} 

In eu 3.1, there is no way to get these short of something like a float64 conversion. In 4.0 you can to enter them in scientific notation and get full accuracy. The standard floating point scanner loses accuracy after a few digits (I don't recall exactly where).

You can look at scientific.e, which is part of euphoria for 4.0, for more info.

Matt

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

4. Re: Largest/smallest atom

mattlewis said...
jemima said...

While I know they are about +/- 1e308, is there some way to specify the largest/smallest atom such as float64_to_atom(#FF,#FF,...})??

These are the largest and smallest magnitude atoms (and their float64 representations):

    1.7976931348623157e+308 {255,255,255,255,255,255,239,127} 

In eu 3.1, there is no way to get these short of something like a float64 conversion.

Thanks, I would have replied sooner but it would not let me log on. Above is the +ve one I was after, anyone know the -ve one? I have no problem using a conversion from a sequence of 8 bytes.

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

5. Re: Largest/smallest atom

jemima said...
mattlewis said...

These are the largest and smallest magnitude atoms (and their float64 representations):

    1.7976931348623157e+308 {255,255,255,255,255,255,239,127} 

In eu 3.1, there is no way to get these short of something like a float64 conversion.

Thanks, I would have replied sooner but it would not let me log on. Above is the +ve one I was after, anyone know the -ve one? I have no problem using a conversion from a sequence of 8 bytes.

It's the same number, just negative (just the sign bit is different in the floating point representation):

    -1.7976931348623157e+308 {255,255,255,255,255,255,239,255} 

Matt

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

6. Re: Largest/smallest atom

mattlewis said...
jemima said...
mattlewis said...

These are the largest and smallest magnitude atoms (and their float64 representations):

    1.7976931348623157e+308 {255,255,255,255,255,255,239,127} 

In eu 3.1, there is no way to get these short of something like a float64 conversion.

Thanks, I would have replied sooner but it would not let me log on. Above is the +ve one I was after, anyone know the -ve one? I have no problem using a conversion from a sequence of 8 bytes.

It's the same number, just negative (just the sign bit is different in the floating point representation):

    -1.7976931348623157e+308 {255,255,255,255,255,255,239,255} 

Matt

Thanks Matt

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

Search



Quick Links

User menu

Not signed in.

Misc Menu