[DUG] Maths problem for the day

2011-01-10 Thread Ross Levis
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

Re: [DUG] Maths problem for the day

2011-01-10 Thread Glenn Crouch
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

Re: [DUG] Maths problem for the day

2011-01-10 Thread Jolyon Smith
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

Re: [DUG] Maths problem for the day

2011-01-10 Thread Colin/Mina
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

Re: [DUG] Maths problem for the day

2011-01-10 Thread Jolyon Smith
- 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

Re: [DUG] Maths problem for the day

2011-01-10 Thread Jolyon Smith
] 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

Re: [DUG] Maths problem for the day

2011-01-10 Thread Colin/Mina
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

Re: [DUG] Maths problem for the day

2011-01-10 Thread Jolyon Smith
...@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

Re: [DUG] Maths problem for the day

2011-01-10 Thread Jolyon Smith
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

Re: [DUG] Maths problem for the day

2011-01-10 Thread Ross Levis
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

Re: [DUG] Maths problem for the day

2011-01-10 Thread Karl Reynolds
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