Results 1 to 2 of 2

Thread: Range error on minimal value of Longint

  1. #1

    Range error on minimal value of Longint

    I DON'T have problems with this code:

    [pascal] if (PInt64(Valor)^ >= -12 and (PInt64(Valor)^ <127>= -3276 and (PInt64(Valor)^ <32767>= 0) and (PInt64(Valor)^ <= 4294967295) then
    ...
    [/pascal]

    But I'm getting an error on this one:

    [pascal] if (PInt64(Valor)^ >= -214748364 and (PInt64(Valor)^ <= 2147483647) then
    ...

    [Error] MSerie.pas(990): Overflow in conversion or arithmetic operation
    [/pascal]

    According to Delphi's help Longint range is: -2147483648..2147483647

    If I use -214748364[size=18px]7[/size] it works! But why not with the full range? :? Any idea how to deal with that problem?

  2. #2

    Range error on minimal value of Longint

    Muahahahaha! I did it!

    [pascal]const
    X: Longint = -2147483647-1;[/pascal]

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •