Click here to Skip to main content
15,884,836 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: Unicode to html Pin
Paul Conrad21-Jul-08 4:20
professionalPaul Conrad21-Jul-08 4:20 
AnswerRe: Unicode to html Pin
dojohansen22-Jul-08 22:09
dojohansen22-Jul-08 22:09 
QuestionWrap values with upper and lower bound? [modified] Pin
Thrash50520-Jul-08 11:08
Thrash50520-Jul-08 11:08 
AnswerRe: Wrap values with upper and lower bound? [modified] Pin
Luc Pattyn20-Jul-08 11:31
sitebuilderLuc Pattyn20-Jul-08 11:31 
GeneralRe: Wrap values with upper and lower bound? Pin
Thrash50520-Jul-08 11:55
Thrash50520-Jul-08 11:55 
GeneralRe: Wrap values with upper and lower bound? Pin
Luc Pattyn20-Jul-08 12:01
sitebuilderLuc Pattyn20-Jul-08 12:01 
GeneralRe: Wrap values with upper and lower bound? Pin
Thrash50520-Jul-08 12:14
Thrash50520-Jul-08 12:14 
GeneralRe: Wrap values with upper and lower bound? Pin
Luc Pattyn20-Jul-08 12:26
sitebuilderLuc Pattyn20-Jul-08 12:26 
OK,

This page[^] explains a bit about modulo for negative numbers.

Seems like in C# a%b will return in (-b,0] for negative a, always assuming positive b.

To fix this, you will need a conditional test.
Either check for origValue<low and="" use="" another="" formula="" if="" it="" mode="hold">or keep the formula, and add another diff if it resulted below low.

As a hack, you could forget the test, and start of with originalValue+99999*(high-low)
but doing so reduces your useful range and/or risks an overflow, which would ruin
everything.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

Voting for dummies? No thanks. Dead | X|


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 
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 

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.