Click here to Skip to main content
15,892,161 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: Postfix Multidigit Expression Evaluation in C# Pin
cp987619-Jul-08 2:17
cp987619-Jul-08 2:17 
GeneralRe: Postfix Multidigit Expression Evaluation in C# Pin
Luc Pattyn19-Jul-08 2:22
sitebuilderLuc Pattyn19-Jul-08 2:22 
GeneralRe: Postfix Multidigit Expression Evaluation in C# Pin
Paul Conrad19-Jul-08 11:01
professionalPaul Conrad19-Jul-08 11:01 
QuestionConvert a value in one number range to a value in another number range? Pin
Thrash50513-Jul-08 13:23
Thrash50513-Jul-08 13:23 
AnswerRe: Convert a value in one number range to a value in another number range? Pin
Luc Pattyn13-Jul-08 13:24
sitebuilderLuc Pattyn13-Jul-08 13:24 
GeneralRe: Convert a value in one number range to a value in another number range? Pin
Thrash50513-Jul-08 13:42
Thrash50513-Jul-08 13:42 
GeneralRe: Convert a value in one number range to a value in another number range? Pin
Luc Pattyn13-Jul-08 14:10
sitebuilderLuc Pattyn13-Jul-08 14:10 
AnswerRe: Convert a value in one number range to a value in another number range? Pin
Nelek14-Jul-08 21:37
protectorNelek14-Jul-08 21:37 
To that things you can always use the Rule of 3 (literal traduction from "Regla de 3" on spanish, don't know the correct name)

RangeMax1 ----- RangeMax2

Value1 -------- Value2

To know the equivalent of one value into another different range. Lets say you have the RangeMax1, RangeMax2 and Value1 and you want to know the Value2. It is made with:

Value2 = (RangeMax2 * Value1) / RangeMax1

if you want to find Value1 then:

Value1 = (RangeMax1 * Value2) / RangeMax2


You multiply the 2 members of the fully known diagonal, and divide with the other number in the diagonal of the desired value.

If you use the RangeMaxes and the Unit... you have the generic formule of your transformation or the coeficient you need.
40 ------ 10000
1 ------- x

x = 10000 * 1 / 40; x = 250


EDIT:
I forgot to say, that the range has to be in absolute width. I mean [-2, 18], translates into 0 ---- 20, you should afterwards adapt the calculated value.
Let's say... I have the value -1,5 in the range [-5, 10] and want to know its equivalent in the range [5, 42]

10 - (-5) = 15
42 - 5 = 37
-1,5 - (-5) = 3,5

15 ------ 37
3,5 ----- x

x = (37 * 3,5) / 15 = 8,633

8,633 + 5 = 13,633

the equivalent is 13,633

Regards.
--------
M.D.V. Wink | ;)

If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.

QuestionRe: Convert a value in one number range to a value in another number range? Pin
feekejd14-Aug-08 1:43
feekejd14-Aug-08 1:43 
AnswerRe: Convert a value in one number range to a value in another number range? Pin
Roger Wright15-Jul-08 19:54
professionalRoger Wright15-Jul-08 19:54 
GeneralRe: Convert a value in one number range to a value in another number range? Pin
Nelek16-Jul-08 21:32
protectorNelek16-Jul-08 21:32 
GeneralRe: Convert a value in one number range to a value in another number range? Pin
CPallini16-Jul-08 21:50
mveCPallini16-Jul-08 21:50 
QuestionUsing CompareExchange to synthesize bigger atomic operations Pin
supercat912-Jul-08 12:54
supercat912-Jul-08 12:54 
QuestionJava Algorithms Pin
benjamin yap11-Jul-08 7:38
benjamin yap11-Jul-08 7:38 
AnswerRe: Java Algorithms Pin
Alan Balkany11-Jul-08 9:14
Alan Balkany11-Jul-08 9:14 
AnswerRe: Java Algorithms Pin
Paul Conrad11-Jul-08 10:31
professionalPaul Conrad11-Jul-08 10:31 
GeneralRe: Java Algorithms Pin
Luc Pattyn11-Jul-08 10:56
sitebuilderLuc Pattyn11-Jul-08 10:56 
GeneralRe: Java Algorithms Pin
Paul Conrad11-Jul-08 10:58
professionalPaul Conrad11-Jul-08 10:58 
QuestionRandom number generator Pin
Kwanalouie10-Jul-08 9:17
Kwanalouie10-Jul-08 9:17 
AnswerRe: Random number generator [modified] Pin
Scorch10-Jul-08 10:03
Scorch10-Jul-08 10:03 
AnswerRe: Random number generator Pin
Luc Pattyn10-Jul-08 13:08
sitebuilderLuc Pattyn10-Jul-08 13:08 
AnswerRe: Random number generator Pin
Mark Churchill10-Jul-08 14:47
Mark Churchill10-Jul-08 14:47 
AnswerRe: Random number generator Pin
cp987611-Jul-08 0:44
cp987611-Jul-08 0:44 
AnswerRe: Random number generator Pin
yassir hannoun19-Jul-08 2:42
yassir hannoun19-Jul-08 2:42 
GeneralRe: Random number generator Pin
PIEBALDconsult9-Aug-08 19:28
mvePIEBALDconsult9-Aug-08 19:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.