Yes, good idea. To my knowledge, the page on = is entirely correct--the truth, the whole truth, and nothing but the truth. I will modify the pages for <. and >., and in particular put a warning there that the result may not have the integer type.
The tolerant comparison page, to my surprise, does give a correct treatment of floor and ceiling (see tfloor and tceiling near the bottom). Since the implementation is not at all intuitive, I'll add a short description of why those forms are used and why others wouldn't work. Marshall On Sun, Feb 07, 2016 at 11:08:51PM -0500, Henry Rich wrote: > Yo Marshall, > > Would you mind updating the Wiki with what you have discussed here > about how tolerant comparison works? I can think of the NuVoc page > for = and > > http://code.jsoftware.com/wiki/Essays/Tolerant_Comparison > > as reasonable places to modify. > > Henry Rich > > On 2/6/2016 4:38 PM, Marshall Lochbaum wrote: > >Based on the recent discussions about integers and floats, I decided to > >make a general tool to convert between various J types. It's hosted > >here: > > > >https://github.com/mlochbaum/JScripts/blob/master/Misc/typecast.ijs > > > >The script defines typecast, a verb to convert between types while > >maintaining J equivalence (-:), and numcast, a verb which converts > >between numeric types and guarantees no errors. Both of these operations > >are quite error-prone, so it's good to have a reference with (lightly, > >at the moment) tested verbs to perform them. > > > >My goal is to eventually have a glossary of ways to convert between > >types. I will probably make typecast suggest alternative conversion > >methods if it fails on a particular argument. So I'm curious if anyone > >knows of interesting and useful ways to convert types. The ones I know > >of are: > > > >- Conversions (3!:x) from numbers to bytes > >- (0&~:) to convert numbers to booleans > >- (mod 2^64) conversion from exact to 64-bit integer > >- Representations (5!:x) from nouns (or other parts of speech) to > > strings or boxes. > >- Gerund representation for a verb > >- The sneaky trick which boxes a part of speech directly > > > >Any others? > > > >Marshall > >---------------------------------------------------------------------- > >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
