Host introspection: Difference between revisions

J: clean up sleepy mistake
(J: clean up sleepy mistake)
Line 307:
=={{header|J}}==
 
<lang j> IF64 {;:'little32 big'64
little64</lang>
 
This returns <code>big32</code> in 6432 bit J.
 
Note that this mechanism is testing the interpreter, and not the OS or Hardware. (Though, of course, you cannot run a 64 bit interpreter on a machine that does not support it.)
 
That said, this does not deal with endianness. For the most part, J programs do not need to know their own endianness. When converting to and from binary format you can specify "native", "little endian" and "big endian", and it's rare that you have an interface with conflicting needs. That said:
 
<lang j> ":&> (|: 32 64 ;"0 big`little) {"_1~ 2 2 #: 16b_e0 + a. i. 0 { 3!:1 ''
64
little</lang>
 
=={{header|Java}}==
6,962

edits