This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Efficient integer division (quotient) and modulo
- From: Rob Hunter <rhunter at mercedsystems dot com>
- To: <kawa at sources dot redhat dot com>
- Date: Tue, 03 Jul 2007 08:40:44 -0700
- Subject: Efficient integer division (quotient) and modulo
Does anyone know how, in Kawa, I can write something like
(/ a b)
and
(modulo a b)
(where a and b are <int>), and have it compile to efficient bytecode? I.e.,
the bytecode that would be generated by
int a = ...;
int b = ...;
int c = a / b;
int d = a % b;
Thanks for any advice,
Rob