Howdy,

Note that the example functions below would return false for
IsInf(-Inf) which may not be
expected.

Duke

On Tue, Dec 6, 2011 at 9:53 AM, Nick Wellnhofer <[email protected]> wrote:
> On 06/12/2011 11:09, Moritz Lenz wrote:
>>
>> Hi all,
>>
>> for some operations in Rakudo it is important for us to check if a num
>> value is one of Inf/-Inf/NaN.
>
>
> Something like the following should work without new ops:
>
> isNaN(d) { return d != d; }
> isInf(d) { return d > DBL_MAX; }
> isNegativeInf(d) { return d < -DBL_MAX; }
>
> Nick
> _______________________________________________
> http://lists.parrot.org/mailman/listinfo/parrot-dev



-- 
Jonathan "Duke" Leto <[email protected]>
Leto Labs LLC
209.691.DUKE // http://labs.leto.net
NOTE: Personal email is only checked twice a day at 10am/2pm PST,
please call/text for time-sensitive matters.
_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Reply via email to