Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add new advanced records for integer and floating point ranges #45

Open
1 of 2 issues completed
Open
Assignees
delphidabbler
Labels
acceptedIssue will be actionedenhancementNew feature or requestin progressWork has started on this issue
@delphidabbler

Description

@delphidabbler

In issue#44 it became apparent that functions to work with ranges would be useful, including adding functions to get the length of a range.

After playing around with the existing simple structure and theTRangeEx advanced record it seems that newer advanced records would be useful.

We can't adaptTRangeEx because its constructor doesn't normalise the range so that the smallest value is the lowest. Changing the behaviour of that constructor isn't viable since doing that could break existing code.

So two new advanced records are proposed:TDoubleRange andTIntegerRange.

Each should have the following attributes and methods:

  • The range should be normalised so that the lower bound <= the upper bound. This should be enforced by the constructor.
  • The range should be immutable => the fields should be hidden and accessed via read-only properties.
  • There should be aContains method.
  • There should be aLength method.
  • There should be aConstrain method to ensure a value fits into range.

We will allow a range of zero length where the upper and lower bounds are the same.

Question: should we have an enumeration that allows us to specify whether the bounds and inclusive or exclusive? If so should that be an immutable property of the range or should it just be passed to relevant functions. Should such a property only be applied to real ranges and not to integer ranges.

Sub-issues

Metadata

Metadata

Assignees

Labels

acceptedIssue will be actionedenhancementNew feature or requestin progressWork has started on this issue

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp