0.0 is negative with CogVM

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

0.0 is negative with CogVM

Levente Uzonyi-2
 
Hi!


I downloaded the prebuilt CogVM from
http://www.mirandabanda.org/files/Cog/VM/VM.r2310/ for Windows and found
that 0.0 has strange behavior:

0.0 negative. "true"
0.0 < 0. "true"
0.0 as: WordArray. "a WordArray(0 0)"

while in SqueakVM

0.0 negative. " false"
0.0 < 0. "false"
0.0 as: WordArray. "a WordArray(0 0)"


Levente
Reply | Threaded
Open this post in threaded view
|

Re: 0.0 is negative with CogVM

Eliot Miranda-2
 
Hi Levente,

On Mon, Sep 20, 2010 at 7:56 AM, Levente Uzonyi <[hidden email]> wrote:

Hi!


I downloaded the prebuilt CogVM from http://www.mirandabanda.org/files/Cog/VM/VM.r2310/ for Windows and found that 0.0 has strange behavior:

0.0 negative. "true"
0.0 < 0. "true"
0.0 as: WordArray. "a WordArray(0 0)"

while in SqueakVM

0.0 negative. " false"
0.0 < 0. "false"
0.0 as: WordArray. "a WordArray(0 0)"

Thank you!  I have been looking superficially at Nicholas' NaN tests and have fixed two of the problems (comparisons of NaNs are ordered as in the interpreter and division by 0.0 now fails).  But in doing that  was seeing some strange results in closeTo: et al.  This symptom looks to be related but it could underlie a lot of problems.  At least it's an easily debuggable case.

self assert: (Compiler evaluate: '0.0') negative not




Levente

Reply | Threaded
Open this post in threaded view
|

Re: 0.0 is negative with CogVM

Eliot Miranda-2
In reply to this post by Levente Uzonyi-2
 


On Mon, Sep 20, 2010 at 7:56 AM, Levente Uzonyi <[hidden email]> wrote:

Hi!


I downloaded the prebuilt CogVM from http://www.mirandabanda.org/files/Cog/VM/VM.r2310/ for Windows and found that 0.0 has strange behavior:

0.0 negative. "true"
0.0 < 0. "true"
0.0 as: WordArray. "a WordArray(0 0)"

while in SqueakVM

0.0 negative. " false"
0.0 < 0. "false"
0.0 as: WordArray. "a WordArray(0 0)"

Fixed in r2312.  I had misread the code generated by gcc and instead of transforming a < b into !(b > a) and a <= b into (!b >= a) I had transformed a < b into !(b >= a) and a <= b into !(b > a).  Tricky.

Eliot



Levente

Reply | Threaded
Open this post in threaded view
|

Re: 0.0 is negative with CogVM

Levente Uzonyi-2
 
On Tue, 21 Sep 2010, Eliot Miranda wrote:

> Fixed in r2312.  I had misread the code generated by gcc and instead of
> transforming a < b into !(b > a) and a <= b into (!b >= a) I had
transformed
> a < b into !(b >= a) and a <= b into !(b > a).  Tricky.

Thanks, it works well now, also all Float-related tests pass.


Levente