On Wed, 27 May 2015, Damian McGuckin wrote:

> Do (1) now as you suggest, and eventually, check out explicitly with an email 
> to the Julia and D lists,

The OCAMP docs says

val mod_float : float -> float -> float

mod_float a b returns the remainder of a with respect to b. The returned 
value is a -. n *. b, where n is the quotient a /. b rounded towards zero 
to an integer.

        http://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html

I just looked up LISP and I noticed it uses 'floor'. They spell out their 
implementat 'REM' and it is definitely violation of that standard but it 
is actually in agreeance of C99 'fmod'. Not sure Lisp is up there with my
choice of HPC languages.

I am fairly sure that the old X86 'FPREM' instruction mandates truncation. 
While that is not a standard, changing 'mod' behaviour to use floor to 
then render that instruction into the future seems pointless.

Also if one is going to implement a simultaneous div/mod function which 
provides both the quotient and the 'modulus', I would want returned a 
truncated result for the division (to be of any use to me).

Regards - Damian

Pacific Engineering Systems International, 277-279 Broadway, Glebe NSW 2037
Ph:+61-2-8571-0847 .. Fx:+61-2-9692-9623 | unsolicited email not wanted here
Views & opinions here are mine and not those of any past or present employer

------------------------------------------------------------------------------
_______________________________________________
Chapel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-users

Reply via email to