Re: Long conditional
Re: Long conditional
- Subject: Re: Long conditional
- From: Ron Jenkins <email@hidden>
- Date: Sat, 4 Jan 2003 18:31:22 -0500
You might also consider using an intermediate temperature scale (maybe
Kelvin) between your conversions. So to change from scale A to scale B
change A to Kelvin then change Kelvin to B. Cuts down on the number of
equations required considerably.
Ron
On Fri, 3 Jan 2003 19:50:47 -0800, Andrew Merenbach
<email@hidden> said:
I'm developing a program that includes a unit converter which, among
other things, can convert from any one of five temperature scales to
any of the other five temperature scales. The code is hard to
maintain, unfortunately, as I use a rather long conditional (with
multiple sub-conditionals) to determine the "to" and "from" scales.
Is there some (elegant) way to use a matrix-like setup (a
two-dimensional selector or even an array?) that, given two arguments
(a range of five numbers, for each of the temperature scales) will
execute a different one of 25 equations or selectors?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.