bug in maximum object

Apr 12, 2007 at 9:47am

bug in maximum object

maximum object has a little bug when the left input is an integer and
the right input is a float.

have a look at the example

Roald Baudoux

#P window setfont “Sans Serif” 9.;
#P flonum 235 310 94 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 235 290 106 196617 expr max($f1\, $f2);
#P window linecount 2;
#P comment 401 235 90 196617 OK when both inputs are floats;
#P window linecount 1;
#P newex 303 213 65 196617 maximum 0.;
#P number 188 158 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 358 158 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 188 241 94 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 188 213 65 196617 maximum 0.;
#P flonum 303 241 94 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 188 64 48 196617 loadbang;
#P button 188 86 15 0;
#P newex 188 108 180 196617 t 1.1 1.2;
#P window linecount 2;
#P comment 93 239 90 196617 error when left input is an integer;
#P window linecount 1;
#P comment 345 291 83 196617 current solution;
#P connect 9 0 6 0;
#P connect 9 0 12 0;
#P connect 8 0 6 1;
#P connect 8 0 12 1;
#P connect 8 0 10 1;
#P connect 12 0 13 0;
#P connect 6 0 7 0;
#P connect 2 0 9 0;
#P fasten 2 0 10 0 193 147 308 147;
#P connect 10 0 5 0;
#P connect 2 1 8 0;
#P connect 4 0 3 0;
#P connect 3 0 2 0;
#P window clipboard copycount 14;

#31327
Apr 12, 2007 at 10:21am

Yub, not as it should be. Another example using a list, maybe a bit easier to understand:

#P flonum 57 171 68 12 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 139 109 119 196620 should output 1.2 too?;
#P comment 126 83 100 196620 should output 1.2;
#P message 73 84 37 196618 1.2 1;
#P message 88 109 37 196618 1 1.2;
#P message 57 57 42 196618 1 2 3;
#P newex 57 146 68 196618 maximum 0.;
#P comment 110 56 100 196620 should output 3;
#P connect 1 0 7 0;
#P connect 4 0 1 0;
#P connect 3 0 1 0;
#P connect 2 0 1 0;

#101638

You must be logged in to reply to this topic.