Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #431 (assigned task)

Opened 1 year ago

Last modified 3 months ago

min() and max() don't really belong in math.Math

Reported by: Don Clugston Assigned to: sean (accepted)
Priority: major Milestone: 1.0
Component: Core Functionality Version: 0.97 RC1
Keywords: triage Cc:

Description

Currently min and max are in math.Math. I don't think they belong there. Apart from abs(), everything else in math operates on floating-point numbers.

* min and max need to be template functions, and should work with user-defined types.

* min() and max() don't actually work for floating point types! maxNaN() and maxNum() serve that role.

The question is, where should they go?

Change History

04/25/07 15:59:43 changed by sean

Good question. C++ has these in <algorithm> which has no Tango analogue. About the closest is tango.core.Array, which doesn't suggest to me that min/max belong there. We may need a new module in either core or util.

05/05/07 02:11:01 changed by sean

  • status changed from new to assigned.

09/05/07 14:56:54 changed by sean

  • milestone set to 1.0.

09/30/07 19:24:10 changed by kris

  • owner changed from sean to Don Clugston.
  • status changed from assigned to new.

10/01/07 02:38:35 changed by Don Clugston

Well, I can just remove them from math.Math and close this ticket. We'll need a new ticket for them to go into core or util, but maybe that's a better demarkation of responsibilities anyway.

10/01/07 03:34:08 changed by larsivi

  • owner changed from Don Clugston to sean.

I'm reassigning the ticket to Sean, such that he can do the move. I don't think we should remove, then readd, but just move :)

05/24/08 14:16:27 changed by larsivi

  • keywords set to triage.

07/26/08 17:23:04 changed by sean

  • status changed from new to assigned.

I agree that they should be moved, just not sure where. Accepting this ticket while I figure it out.