Thanks. It is pretty obvious now. I should have spent a few more minutes 
looking through NuVoc.
Regards.

> Date: Sat, 7 Jun 2014 11:27:23 +0100
> From: [email protected]
> To: [email protected]
> Subject: Re: [Jprogramming] Float to integer testing and conversion
> 
> How can I test if a float is an integer? 
> 
>   (=<.)3.3
> 0
>    (=<.)3.0
> 1
>    (=<.)2j1
> 1
>    (=<.)2j1.1
> 0
> 
> OK?
> Bo.
> 
> 
> 
> Den 12:12 lørdag den 7. juni 2014 skrev Jon Hough <[email protected]>:
>  
> 
> >
> >
> >If I do 5% 2j1
> >I get: 
> >2j_1 
> >Clearly 2 and _1 are integers, but are represented as floats in the division.
> >i.e. 
> >
> >datatype +. 5%2j1
> >floating
> >How can I test if a float is an integer? e.g. in C:
> >
> >if (value == (int)value){...}
> >My main motivation here is to find gaussian divisors (i.e. gaussian 
> >integers) of different integer values.
> >Regards.
> >                          
> >----------------------------------------------------------------------
> >For information about J forums see http://www.jsoftware.com/forums.htm
> >
> >
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
                                          
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to