Re: Division inconsistency between interpreted and compiled Lush

Yann LeCun <[email protected]> Sat, 24 Dec 2005 12:08:09 -0500
Newsgroups gmane.lisp.lush.devel
Organization Courant Institute, NYU
Message-ID <[email protected]>
Well, I'm not sure how to fix this either, short of extending the
interpreter to handle different numerical types, which is a
non-trivial job (right now, everything is a double in interpreted
mode).

Casting args of / into double would only be a partial solution.  The
same other operation also have different behaviors for different
numerical types. One potential (but rather annoying) solution is to
have numerical functions cast their arguments to a single type (double
for most ops) and return a single type, and make the compiler complain
when the result is assigned to a different type without explicit
conversion.

> What's the file that translates arithmetic functions into C operations? Is
> it dz.c?

Most of it is in lsh/compiler/dh-macro.lsh
Look for "dhm-c /"

  -- Yann


> Hi, I'm not sure where to fix this, but I think the compiler should cast
> any integer arguments to the / function into floats. Right now, both unary
> and binary division work differently in interpreted code and in compiled
> code.
>
> What's the file that translates arithmetic functions into C operations? Is
> it dz.c?
>
> Yury




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click