Click here to Skip to main content
15,891,777 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Wrap values with upper and lower bound? Pin
Thrash50520-Jul-08 12:34
Thrash50520-Jul-08 12:34 
GeneralRe: Wrap values with upper and lower bound? Pin
Luc Pattyn20-Jul-08 12:45
sitebuilderLuc Pattyn20-Jul-08 12:45 
GeneralRe: Wrap values with upper and lower bound? Pin
Thrash50520-Jul-08 12:57
Thrash50520-Jul-08 12:57 
QuestionPostfix Multidigit Expression Evation in C# Pin
sadiyaVasanthKumar18-Jul-08 22:09
sadiyaVasanthKumar18-Jul-08 22:09 
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 
I can't seem to figure this out...

I have a value within the range of 0 to 40 and I want to be able to convert that into a value in the range of 0 to 10,000.

This is for a simple music player that I have built into one of my programs. I'm using C# and DirectX.AudioVideoPlayback to play mp3 files. I have a working custom slider control that has a range from 0 to 40. This will be used to adjust the volume of an mp3.

The problem is that volume in DirectX.AudioVideoPlayback ranges from 0 to 10,000 (technically -10,000 to 0... 0 being max volume). Therefore I need to figure out a formula to convert a value from my custom slider control that is in the range 0 to 40, to a value DirectX.AudioVideoPlayback can use which is in the range of 0 to 10,000. Also these values are integers and the conversion doesn't have to be exact, just close enough.

I'm bad at math, so any ideas?
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 
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 

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.