[8.5.2] Calling a PlatformFunction with a Signalling NaN

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[8.5.2] Calling a PlatformFunction with a Signalling NaN

Richard Sargent
Administrator
I am getting a primitive error #9 (Unknown floating point exception) when calling the following Platform Function with a Signalling NaN. Can anyone from Instantiations confirm whether this is an expected behaviour, and if so whether there is anything I can do to prevent it?

<c: int32 'gcirpc32':GciFloatKind double>

The purpose of the function is to return an integer categorizing the argument. It isn't helpful when it yields a primitive error.

I have also tried it with <c: int32 'gcirpc32':GciFloatKind float>, and the same result.

I found the following information in the Programmer's Guide, but it doesn't really address this topic.
"float, double, extended
If used as a parameter type, the parameter must be a Float. The parameter is converted to the specified size of float."

At this point, I am guessing that the "conversion" to a C double is acting on the "signalling" aspect. I do not see this problem with Quiet NaNs, nor with Infinity values.

In case it matters, the exact representation of the Float is  FF F0 00 00 00 00 00 01.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: [8.5.2] Calling a PlatformFunction with a Signalling NaN

Seth Berman
Thanks Richard,

I will have to research this a little more, so I will add to the queue to take a look at.

-- Seth

On Wednesday, February 26, 2014 2:54:42 PM UTC-5, Richard Sargent wrote:
I am getting a primitive error #9 (Unknown floating point exception) when calling the following Platform Function with a Signalling NaN. Can anyone from Instantiations confirm whether this is an expected behaviour, and if so whether there is anything I can do to prevent it?

<c: int32 'gcirpc32':GciFloatKind double>

The purpose of the function is to return an integer categorizing the argument. It isn't helpful when it yields a primitive error.

I have also tried it with <c: int32 'gcirpc32':GciFloatKind float>, and the same result.

I found the following information in the Programmer's Guide, but it doesn't really address this topic.
"float, double, extended
If used as a parameter type, the parameter must be a Float. The parameter is converted to the specified size of float."

At this point, I am guessing that the "conversion" to a C double is acting on the "signalling" aspect. I do not see this problem with Quiet NaNs, nor with Infinity values.

In case it matters, the exact representation of the Float is  FF F0 00 00 00 00 00 01.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/groups/opt_out.