PR# 19879 {INTEGER_32}.min_value = - {INTEGER_32}.min_value returns True

Problem Report Summary
Submitter: martin-east
Category: EiffelBase
Priority: Low
Date: 2023/03/30
Class: Bug
Severity: Non-critical
Number: 19879
Release: 22.12
Confidential: No
Status: Open
Responsible:
Environment: win
Synopsis: {INTEGER_32}.min_value = - {INTEGER_32}.min_value returns True

Description
{INTEGER_32}.min_value = - {INTEGER_32}.min_value   returns True

This probably applies to INTEGER_8, 16 and 64 too. 

Although there are good reasons for this behaviour, I would expect the contracts for INTEGER_xx to either:
- document this rather unexpected result 
- prevent any negation of {INTEGER_xx}.min_value, if necessary as a post-condition

In general I believe the contracts should fully document the differences in behaviour of integers and naturals that are represented as fixed width binary values as opposed to abstract mathematical integers and naturals


To Reproduce
Print({INTEGER_32}.min_value = - {INTEGER_32}.min_value)
Problem Report Interactions