Summary
exactness result of max and min is non-R5RS and depends on argument order
Metadata
- Id: a8d9c16e7550e38fd26d6a3eff7783a445e5b0e3
- Trac id: 887
- Type: defect
- Reporter: johnwcowan
- Owner:
- Cc:
- Status: closed
- Component: unknown
- Estimated difficulty:
- Resolution: fixed
- Priority: minor
- Milestone: 4.9.0
- Version: 4.7.x
- Changetime: 2012-09-24 21:47:48 UTC
- Created: 2012-07-14 23:01:40 UTC
- Keywords:
Description
R5RS says that `max` and `min` must return inexact results if any argument is inexact ("unless the procedure can prove that the inaccuracy is not large enough to affect the result, which is possible only in unusual implementations", which does not apply to Chicken). However, Chicken's core versions of `max` and `min` preserve the exactness of the extremum in an inconsistent fashion:
(min 1 2.0) => 1 (min 2.0 1) => 1.0
Seemingly the procedures do not convert the current best notion of the extremum into an inexact value when the first inexact argument is processed.
This bug does not apply when using the numbers egg.
Changes and comments
[2012-07-31 21:27:36 UTC] sjamaan changed status from new to closed
[2012-07-31 21:27:36 UTC] sjamaan set resolution to fixed
[2012-07-31 21:27:36 UTC] sjamaan wrote:
This has been fixed and pushed as commit ab9b93a236ca4337f523672883e3d88015c10346
[2012-09-24 21:47:48 UTC] felix changed milestone from 4.8.0 to 4.9.0
[2012-09-24 21:47:48 UTC] felix wrote:
Milestone 4.8.0 deleted