Convert the following into one line.
if High(Files) 30 then Max := Bias.Position
else if High(Files) 300 then Max := Bias.Position*2
else if High(Files) 3000 then Max := Bias.Position*3
else if High(Files) 3 then Max := Bias.Position*4
etc
I think there must be a way. Probably
Borland Developers Group - Delphi List'
Subject: [DUG] Maths problem for the day
Convert the following into one line.
if High(Files) 30 then Max := Bias.Position
else if High(Files) 300 then Max := Bias.Position*2
else if High(Files) 3000 then Max := Bias.Position*3
else if High(Files
Not Power(), Log10():
Max := Bias.Position * Log10(Files);
From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On
Behalf Of Ross Levis
Sent: Tuesday, 11 January 2011 14:25
To: 'NZ Borland Developers Group - Delphi List'
Subject: [DUG] Maths problem for the day
Why? when what you've written documents well. For the sake of someone
following you should include (Comment) it anyway
- Original Message -
From: Ross Levis
To: 'NZ Borland Developers Group - Delphi List'
Sent: Tuesday, January 11, 2011 2:24 PM
Subject: [DUG] Maths problem
- Delphi List'
Subject: [DUG] Maths problem for the day
Convert the following into one line.
if High(Files) 30 then Max := Bias.Position
else if High(Files) 300 then Max := Bias.Position*2
else if High(Files) 3000 then Max := Bias.Position*3
else if High(Files) 3 then Max
] Maths problem for the day
Convert the following into one line.
if High(Files) 30 then Max := Bias.Position
else if High(Files) 300 then Max := Bias.Position*2
else if High(Files) 3000 then Max := Bias.Position*3
else if High(Files) 3 then Max := Bias.Position*4
etc
I think
To: 'NZ Borland Developers Group - Delphi List'
Subject: [DUG] Maths problem for the day
Convert the following into one line.
if High(Files) 30 then Max := Bias.Position
else if High(Files) 300 then Max := Bias.Position*2
else if High(Files) 3000 then Max := Bias.Position
...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On
Behalf Of Glenn Crouch
Sent: Tuesday, 11 January 2011 14:37
To: 'NZ Borland Developers Group - Delphi List'
Subject: Re: [DUG] Maths problem for the day
Something akin to:
Max := Int (Math.Log10 (High (Files)/ 3.0 - 0.1
Subject: Re: [DUG] Maths problem for the day
That was my point, the original describes exactly what was intended. One
liners generally don't and tend to introduce errors
C.
- Original Message -
From: Jolyon Smith mailto:jsm...@deltics.co.nz
To: 'NZ Borland Developers Group
Group - Delphi List'
Subject: Re: [DUG] Maths problem for the day
Yep - I think in this case there may be a middle ground, something like:
Case High(Files) of
0..29: factor := 1;
30..299 : factor := 2;
..
Else
..
End
Max := Bias.Position * factor
Max := Bias.Position * Trunc(Log10(Math.Max(10, High(Files) * 10 div 3)));
That was my point, the original describes exactly what was intended. One
liners generally don't and tend to introduce errors
The etc kind of throws a spanner in the works. But yes, the
following is slightly more
11 matches
Mail list logo