On Mon, Apr 8, 2019 at 12:37 PM William Tanksley, Jr
<wtanksle...@gmail.com> wrote:
> Raul Miller <rauldmil...@gmail.com> wrote:
> > They can, which is disturbing.
> > However, they don't have to (and they have some other advantages, also...).
>
> They do have to (round and otherwise display non-arithmetic behavior).
> All floats are actually rational numbers which follow a specific
> format and truncate in specific ways.

They have to in some cases, but not for all cases.

Rational representations also have to for some cases - typically far
fewer cases (depending on context), because they have more bits but
that's a space/time tradeoff (which of course can be worth taking).

Nevertheless, 2=1+1 regardless of representation (for example).

That said... yes, if you are working with rationals, and you get a
floating result, you should treat that as a significant error
(probably a coding error).

Thanks,

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to