RealRange.Size

This commit is contained in:
Sun Serega 2023-12-05 12:10:48 +02:00
parent d93371d03c
commit 88d5c3e780
2 changed files with 2 additions and 2 deletions

View file

@ -7,4 +7,4 @@ Assert( ('b'..'c').Count = 2 );
Assert( ('c'..'b').Count = 0 ); Assert( ('c'..'b').Count = 0 );
Assert( (2.0..3).Size = 1 ); Assert( (2.0..3).Size = 1 );
Assert( (3.0..2).Size = -1 ); Assert( (3.0..2).Size = 0 );

View file

@ -769,7 +769,7 @@ type
property Low: real read l; property Low: real read l;
property High: real read h; property High: real read h;
property Size: real read h-l; property Size: real read System.Math.Max(0, h-l);
static function operator in(x: real; r: RealRange): boolean := (x >= r.l) and (x <= r.h); static function operator in(x: real; r: RealRange): boolean := (x >= r.l) and (x <= r.h);