caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Kai Kaminski" <kok@wtal.de>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Integer arithmetic: mod
Date: Sat, 11 Aug 2001 00:10:35 +0200	[thread overview]
Message-ID: <20010811001035.D4854@alpha2.tabu.stw-bonn.de> (raw)
In-Reply-To: <3B6DD833.6030765E@maxtal.com.au>; from skaller@maxtal.com.au on Mon, Aug 06, 2001 at 09:35:15AM +1000

On Mon, Aug 06, 2001 at 09:35:15AM +1000, John Max Skaller wrote:
> > The reason is that whenever such a behaviour is platform-dependent, you
> > can't use it at all, as long as you want to have your programs portable.
> 
> 	Yes you can: it works for non-negative arguments.
> And you can always roll your own function that works as you desire
> for negative ones:
I'm using a high-level language like OCaml and I still have to define my
own 'mod'-operator? I know that it is possible to write a function that
gives me what I want.

> This way, YOU choose whether you want a deterministic result
> for non-negative values (use mod, its fast), or are willing
> to pay extra for determinism for negative values.
With a second operator this wouldn't be a problem. If you need really
fast code and the behaviour for negative numbers doesn't matter, you
just choose the faster one. Your code gets a bit platform specific, but
it is better to 'punish' the few implementors of speed-critical
applications, than all the rest of us.

> But I agree with you anyhow. :-)
IMHO, that's always a good thing ;)

Kai Kaminski
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


  reply	other threads:[~2001-08-10 22:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-04 10:49 Kai Kaminski
2001-08-04 18:48 ` Chris Hecker
2001-08-05 23:35 ` John Max Skaller
2001-08-10 22:10   ` Kai Kaminski [this message]
2001-08-06  9:10 ` Xavier Leroy
2001-08-10 22:29   ` Kai Kaminski
2001-08-13 15:21     ` Xavier Leroy
     [not found] <9khicj$3n3$1@qrnik.zagroda>
2001-08-04 20:25 ` Marcin 'Qrczak' Kowalczyk
2001-08-05  8:05   ` Chris Hecker
2001-08-06  1:06     ` John Gerard Malecki
2001-08-06 13:23 Dave Berry
2001-11-09 10:30 Edmund GRIMLEY EVANS
2001-11-19 15:49 ` Xavier Leroy
2001-11-19 16:48   ` Vesa Karvonen
2001-11-19 16:39 Krishnaswami, Neel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010811001035.D4854@alpha2.tabu.stw-bonn.de \
    --to=kok@wtal.de \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).