jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • groovy
  • GROOVY-513

comparison with Integer.MIN_VALUE behaves incorrectly

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0-beta-5
  • Fix Version/s: 1.0-beta-6
  • Component/s: None
  • Labels:
    None
  • Environment:
    Windows XP

Description

Comparisons with Integer.MAX_VALUE work correctly; comparisons with Integer.MIN_VALUE do not. Consider:

println "8 < MAX_VALUE direct: " + (8 < Integer.MAX_VALUE)
hi = Integer.MAX_VALUE
println "8 < MAX_VALUE indirect: " + (8 < hi)

println "8 > MIN_VALUE direct: " + (8 > Integer.MIN_VALUE)
hi = Integer.MIN_VALUE
println "8 > MIN_VALUE indirect: " + (8 > hi)

The output is:

8 < MAX_VALUE direct: true
8 < MAX_VALUE indirect: true
8 > MIN_VALUE direct: false
8 > MIN_VALUE indirect: false

(Note: there's nothing special about the value '8'...

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Steve Goetze added a comment - 07/Jul/04 11:15 AM

Fixed comparison code in NumberMath subclasses

Show
Steve Goetze added a comment - 07/Jul/04 11:15 AM Fixed comparison code in NumberMath subclasses

People

  • Assignee:
    Steve Goetze
    Reporter:
    Greg Wilson
Vote (0)
Watch (0)

Dates

  • Created:
    02/Jun/04 2:05 PM
    Updated:
    29/Nov/07 8:14 PM
    Resolved:
    07/Jul/04 11:15 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.