Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Multiplication of matrix in C and OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-02-10 (02:31)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] Multiplication of matrix in C and OCaml
On Saturday 10 February 2007 01:41, 
> Sorry, I wanted to say "optimize (a * b) *c == a * (b * c) to true",
> i.e. 1. Would the compiler be wrong/incorrect in doing so?


> I don't think so.

Provided you only specify -O* optimisation flags, I believe that reducing that 
expression to "true" in the general case would be a compiler bug. If you 
specify flags like -ffast-math then anything can happen, but it will happen 
very quickly! ;-)

Dr Jon D Harrop, Flying Frog Consultancy Ltd.
OCaml for Scientists