Possible bug (sorry if it's a repeat)

new topic     » topic index » view thread      » older message » newer message

It seems that Euphoria doesn't generate an error when an integer goes
out of bounds like so:

constant MAX_INTEGER = 1073741823
procedure display_integer(integer z)
    ? z
end procedure
integer x, y
x = MAX_INTEGER
x += 1 -- No error
x = MAX_INTEGER
x = x + 1-- No error
y = x -- No error
? integer(y) -- Displays 0
display_integer(y) -- Error here

I'm not sure whether this is a bug or it is supposed to happen, but it
seems like a bug considering:

constant MAX_INTEGER = 1073741823
type int(object x)
        return integer(x)
end type
int x
x = MAX_INTEGER
x += 1 -- This causes an error

Jeffrey Fielding
JJProg at cyberbury.net
http://members.tripod.com/~JJProg/

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu