expressions: modulus or modulo operator?

Michael Schulz mschulz at WEBGIS.DE
Wed Sep 19 06:13:19 PDT 2007


Hi,

first of all: mapserver 5 rocks. THX.

I have one question: I found in the history.txt that the "modulus"
operator is supported by expressions. Now I am uncertain what is
meant:

- "modulus" the absolute value of a number without a sign or
- "modulo" the rest of an integer division, usually expressed with the
operator "%"

When i looked in mapparser.y i found this line:
345:  math_exp '%' math_exp   { $$ = (int)$1 * (int)$3; }

This looks like the modulo operator is defined, but the calculation is
not modulo.

Can someone shed some light on this?

I am trying to classify isolines with the expression ([iso-value] %
10) and it should draw all iso lines that are dividable by 10 without
a rest, e.g. for giving them a thicker line width. But it nevertheless
draws all lines.

Cheers, Michael

-- 
-----------------------------------------------------------
Michael Schulz
mschulz at webgis.de

in medias res
Gesellschaft für Informationstechnologie mbH

In den Weihermatten 66
79108 Freiburg

Tel  +49 (0)761 556959-5
Fax +49 (0)761 556959-6

http://www.webgis.de / http://www.zopecms.de
-----------------------------------------------------------
+++ INTERGEO 25.09. - 27.09.07 Leipzig - Open Source Park, Halle 3,
Stand K3.302 +++



More information about the MapServer-users mailing list