[ 
https://issues.apache.org/jira/browse/LUCY-32?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Marvin Humphrey updated LUCY-32:
--------------------------------

    Attachment: Probe.charm
                Floats.harm
                charmonize.diff

The vast majority of machines support IEEE 754 floating point formats these
days, and Lucy will only run on such machines.  However, there is no standard
way of notating infinity, negative infinity, or not-a-number in C -- so we
need a Charmonizer module to provide a cross platform compatible F32_INF,
F32_NEGINF, and F32_NAN.

Hacking in support involves casting the literal bit-patterns for these values:

{code:none}
typedef union { chy_i32_t i; float f; } chy_floati32;
static const chy_floati32 chy_f32inf    = {CHY_I32_C(0x7f800000)};
static const chy_floati32 chy_f32neginf = {CHY_I32_C(0xff800000)};
static const chy_floati32 chy_f32nan    = {CHY_I32_C(0x7fc00000)};
#define CHY_F32_INF (chy_f32inf.f)
#define CHY_F32_NEGINF (chy_f32neginf.f)
#define CHY_F32_NAN (chy_f32nan.f)
{code}

In the future, we may add tests at the Charmonizer level which fail if the
box doesn't support IEEE 754.  However, the full Lucy test suite will
definitely blow up on such machines, so it's not like omitting the test will
hide failure.

> Add cross-platform support for inf, -inf, nan
> ---------------------------------------------
>
>                 Key: LUCY-32
>                 URL: https://issues.apache.org/jira/browse/LUCY-32
>             Project: Lucy
>          Issue Type: New Feature
>          Components: Charmonizer
>            Reporter: Marvin Humphrey
>            Assignee: Marvin Humphrey
>            Priority: Minor
>         Attachments: charmonize.diff, Floats.harm, Probe.charm
>
>
> Provide cross-platorm support for special IEEE 754 floating point values
> infinity, negative infinity, and not-a-number.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to