Bug with real / tuples?

Anoq of the Sun anoq@HardcoreProcessing.com
Sun, 30 Sep 2001 12:29:07 +0200


This is a multi-part message in MIME format.
--------------D14F6D2E1C54609396FB9B19
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello!


I've tried compiling some stuff with the new mlton (on Linux
navtive). And I think I've hit a bug - it probably has to
do with reals and tuples (but it could be something else of course...).

I have made a really small program (attached) where the problem occurs.

Short explanation of the program:

translateXYZ creates a 4x4 homogenious translation matrix.
transformPoint transforms a 3D point using the matrix.
Point3DToString converts a 3D point to a string :)

When I do

mlton testMatrix.sml
./testMatrix

I get an output something like this:

{x = inf, y = inf, z = inf}

On SML/NJ it correctly becomes:

{x = 3.0, y = 5.0, z = 7.0}

In my "real" code I have also seen ~inf and nan
occur on mlton during similar matrix calculations.

I'm using my patched version of the 20010806 release
(which still seems to be the latest official release).


Cheers
-- 
http://www.HardcoreProcessing.com


--------------D14F6D2E1C54609396FB9B19
Content-Type: application/x-unknown-content-type-sml_auto_file;
 name="testMatrix.sml"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename="testMatrix.sml"

ZXhjZXB0aW9uIEVycm9yCgpmdW4gdHJhbnNsYXRlWFlaICh0cmFuc2xhdGVYIDogcmVhbCwgdHJh
bnNsYXRlWSA6IHJlYWwsIHRyYW5zbGF0ZVogOiByZWFsKSA9CiAgICAgICgoMS4wLCAwLjAsIDAu
MCwgdHJhbnNsYXRlWCksCiAgICAgICAoMC4wLCAxLjAsIDAuMCwgdHJhbnNsYXRlWSksCiAgICAg
ICAoMC4wLCAwLjAsIDEuMCwgdHJhbnNsYXRlWiksCiAgICAgICAoMC4wLCAwLjAsIDAuMCwgMS4w
KSkKCmZ1biB0cmFuc2Zvcm1Qb2ludCBtYXRyIHt4LCB5LCB6fSA9CiAgICAgICAgICBsZXQKICAg
ICAgICAgICAgdmFsICgoaW4wMCwgaW4wMSwgaW4wMiwgaW4wMyksCiAgICAgICAgICAgICAgICAg
KGluMTAsIGluMTEsIGluMTIsIGluMTMpLAogICAgICAgICAgICAgICAgIChpbjIwLCBpbjIxLCBp
bjIyLCBpbjIzKSwKICAgICAgICAgICAgICAgICAoaW4zMCwgaW4zMSwgaW4zMiwgaW4zMykpID0g
bWF0cgogICAgICAgICAgICAgCiAgICAgICAgICAgIHZhbCB3ID0geCAqIGluMzAgKyB5ICogaW4z
MSArIHogKiBpbjMyICsgaW4zMwogICAgICAgICAgaW4KICAgICAgICAgICAgaWYgUmVhbC49PSAo
MC4wLCB3KSB0aGVuCiAgICAgICAgICAgICAgcmFpc2UgRXJyb3IKICAgICAgICAgICAgZWxzZQog
ICAgICAgICAgICAgIHt4ID0gKChpbjAwICogeCkgKyAoaW4wMSAqIHkpICsgKGluMDIgKiB6KSAr
IGluMDMpIC8gdywKICAgICAgICAgICAgICAgeSA9ICgoaW4xMCAqIHgpICsgKGluMTEgKiB5KSAr
IChpbjEyICogeikgKyBpbjEzKSAvIHcsCiAgICAgICAgICAgICAgIHogPSAoKGluMjAgKiB4KSAr
IChpbjIxICogeSkgKyAoaW4yMiAqIHopICsgaW4yMykgLyB3fQogICAgICAgICAgZW5kCgpmdW4g
UG9pbnQzRFRvU3RyaW5nIHt4LCB5LCB6fSA9CiAgICAgICAgICAie3ggPSAiIF4gKFJlYWwudG9T
dHJpbmcgeCkgXgogICAgICAgICAgIiwgeSA9ICIgXiAoUmVhbC50b1N0cmluZyB5KSBeCiAgICAg
ICAgICAiLCB6ID0gIiBeIChSZWFsLnRvU3RyaW5nIHopIF4KICAgICAgICAgICJ9IgoKCnZhbCBt
ID0gdHJhbnNsYXRlWFlaICgyLjAsIDMuMCwgNC4wKQp2YWwgcCA9IHt4ID0gMS4wLCB5ID0gMi4w
LCB6ID0gMy4wfQp2YWwgcCcgPSB0cmFuc2Zvcm1Qb2ludCBtIHAKdmFsIF8gPSBwcmludCAoUG9p
bnQzRFRvU3RyaW5nIHAnKQo=

--------------D14F6D2E1C54609396FB9B19--