Stupider but funnier: (0=1&|) 3.0 3.3 2j1 2j1.1 1 0 1 0
-Dan PS: having J on my phone everywhere I go is awesome! > On Jun 7, 2014, at 6:27 AM, "'Bo Jacoby' via Programming" > <[email protected]> wrote: > > 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
