Click here to Skip to main content
15,924,901 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Costing terrain paths Pin
Kevnar9-Nov-06 7:14
Kevnar9-Nov-06 7:14 
GeneralRe: Costing terrain paths Pin
ricecake9-Nov-06 7:21
ricecake9-Nov-06 7:21 
GeneralRe: Costing terrain paths Pin
Kevnar9-Nov-06 7:31
Kevnar9-Nov-06 7:31 
GeneralRe: Costing terrain paths Pin
ejuanpp9-Nov-06 3:43
ejuanpp9-Nov-06 3:43 
GeneralRe: Costing terrain paths Pin
Kevnar9-Nov-06 4:13
Kevnar9-Nov-06 4:13 
QuestionBeginners question? Where does the exact double value go? Pin
ClockDivider8-Nov-06 6:48
ClockDivider8-Nov-06 6:48 
AnswerRe: Beginners question? Where does the exact double value go? Pin
Rob Graham8-Nov-06 7:09
Rob Graham8-Nov-06 7:09 
GeneralRe: Beginners question? Where does the exact double value go? Pin
Dan Neely8-Nov-06 7:24
Dan Neely8-Nov-06 7:24 
Base10 numbers can't store all fractional values exactly without infinite repitition (1/3, 1/7, etc). Your computer uses base2 math internally and only converts to base10 for output. base2 can't store all numbers without repeating either. The thing you need to remember is that different bases have different sets of repeaters. In base3 1/3 is written as 0.1 (zero ones and one third), while in base10 1/3 is 0.3333333...... The base2/base10 one that causes the most confusion is 1/10 is a repeater in base2. You can work it out by hand if you want to see it with your own eyes. For financial transactions fixed point datatypes or types that store the number in a base10 format directly are typically used, but they have significant penalty over native base2 math. When precision identical to base10 hand work is not needed as long as it's good enough, native floating point types are used and a comparisons are made in a way that reflects the rounding issues. Instead of testinf equality by (f1-f2) == 0 you use Abs(f1-f2) < epsilon where epsilon is a delta smaller than your allowed error tollerance. If you're doing very extensive computations it's sometimes neccesary to order them in a way that minimizes total error, but normal applications generally don't need to worry about this.

for more detail see below. It's probably more detail than you need but is the best web reference I'm aware of.
http://docs.sun.com/source/806-3568/ncg_goldberg.html[^]

--
Rules of thumb should not be taken for the whole hand.

GeneralRe: Beginners question? Where does the exact double value go? Pin
ClockDivider8-Nov-06 8:15
ClockDivider8-Nov-06 8:15 
QuestionScaling - help me Pin
dharani7-Nov-06 0:06
dharani7-Nov-06 0:06 
AnswerRe: Scaling - help me Pin
Jörgen Sigvardsson7-Nov-06 13:02
Jörgen Sigvardsson7-Nov-06 13:02 
GeneralBresenhams algorithm for drawing lines Pin
Jörgen Sigvardsson6-Nov-06 12:59
Jörgen Sigvardsson6-Nov-06 12:59 
GeneralRe: Bresenhams algorithm for drawing lines Pin
Luc Pattyn6-Nov-06 13:43
sitebuilderLuc Pattyn6-Nov-06 13:43 
GeneralRe: Bresenhams algorithm for drawing lines Pin
Jörgen Sigvardsson6-Nov-06 14:03
Jörgen Sigvardsson6-Nov-06 14:03 
GeneralRe: Bresenhams algorithm for drawing lines Pin
Bassam Abdul-Baki6-Nov-06 13:45
professionalBassam Abdul-Baki6-Nov-06 13:45 
GeneralRe: Bresenhams algorithm for drawing lines Pin
Jörgen Sigvardsson6-Nov-06 14:09
Jörgen Sigvardsson6-Nov-06 14:09 
GeneralRe: Bresenhams algorithm for drawing lines Pin
Michael Dunn7-Nov-06 15:27
sitebuilderMichael Dunn7-Nov-06 15:27 
QuestionNearest neighbour algorithm Pin
Islam Khalil Saber6-Nov-06 4:33
Islam Khalil Saber6-Nov-06 4:33 
AnswerRe: Nearest neighbour algorithm Pin
ejuanpp6-Nov-06 4:54
ejuanpp6-Nov-06 4:54 
GeneralRe: Nearest neighbour algorithm Pin
Islam Khalil Saber6-Nov-06 13:13
Islam Khalil Saber6-Nov-06 13:13 
QuestionTravelling Salesman Problem Pin
and_reas5-Nov-06 23:11
and_reas5-Nov-06 23:11 
AnswerRe: Travelling Salesman Problem Pin
Just me at will_george...something6-Nov-06 6:01
Just me at will_george...something6-Nov-06 6:01 
GeneralRe: Travelling Salesman Problem Pin
Steve S7-Nov-06 1:03
Steve S7-Nov-06 1:03 
GeneralRe: Travelling Salesman Problem Pin
Just me at will_george...something8-Nov-06 2:22
Just me at will_george...something8-Nov-06 2:22 
AnswerRe: Travelling Salesman Problem Pin
mehata7-Nov-06 16:57
mehata7-Nov-06 16:57 

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.