mat BUG

Pondering the philosophy behind the language

mat BUG

Postby kosh » Tue Jul 26, 2016 8:33 pm

Hello Lutz.

"mat" function returns incorrect value on 64-bit system.
(This problem is confirmed on Windows and macOSX both 32/64-bit)

Code: Select all
C:\>newlisp -v
newLISP v.10.7.0 32-bit on Windows IPv4/6 UTF-8 libffi.

C:\>newlisp -e "(mat * '((1 2 3) (4 5 6)) -1)"
((-1 -2 -3) (-4 -5 -6))

C:\>newlisp-x64 -v
newLISP v.10.7.0 64-bit on Windows IPv4/6 UTF-8 libffi.

C:\>newlisp-x64 -e "(mat * '((1 2 3) (4 5 6)) -1)"
((1.844674407370955e+019 3.68934881474191e+019 5.534023222112866e+019) (7.378697629483821e+019
  9.223372036854776e+019 1.106804644422573e+020))


Regards.
kosh
 
Posts: 68
Joined: Sun Sep 13, 2009 5:38 am
Location: Japan

Re: mat BUG

Postby rickyboy » Tue Jul 26, 2016 9:56 pm

Here too.

Code: Select all
$ uname -srm
OpenBSD 6.0 amd64
$ newlisp -v
newLISP v.10.7.0 64-bit on BSD IPv4/6 UTF-8.
$ newlisp -e "(mat * '((1 2 3) (4 5 6)) -1)"
((1.844674407370955e+19 3.68934881474191e+19 5.534023222112865e+19) (7.378697629483821e+19
  9.223372036854776e+19 1.106804644422573e+20))

Thanks, kosh, for finding this.
(λx. x x) (λx. x x)
rickyboy
 
Posts: 572
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Re: mat BUG

Postby Lutz » Wed Jul 27, 2016 1:54 am

Thanks Kosh and Rickyboy, now working:

http://www.newlisp.org/downloads/develo ... nprogress/

Code: Select all
newLISP v.10.7.1 64-bit on OSX IPv4/6 UTF-8 libffi, options: newlisp -h

> (mat * '((1 2 3) (4 5 6)) -1)
((-1 -2 -3) (-4 -5 -6))

> (mat * '((1 2 3) (4 5 6)) (float -1)) ;; on 10.7.0 64-bit cast the scalar argument as a float
((-1 -2 -3) (-4 -5 -6))
>


On broken 64-bit versions cast the scalar argument as a float as shown in the example
Lutz
 
Posts: 5276
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California


Return to Whither newLISP?

Who is online

Users browsing this forum: No registered users and 1 guest