From: Kevin K. <ke...@ac...> - 2009-05-25 22:24:18
|
Andreas Kupries wrote: > 1. What about infinity values... In my implementation of Bellman Fords I >> just added string "inf", as a value of infinity ( in initialization we >> assign value of infinity on each distance we are searching for). Is it >> okay, or you've got other way to assign those values? > > Let me check something ... I believe that in Tcl 8.5 we have standard strings > for the infinities already. Matching these would be a good thing, even if we > are working with Tcl 8.4 ... > > % tclsh > % info patchlevel > 8.5.7 > % expr log(0) > -Inf > > Yes. The standard strings are "Inf" and "-Inf". > > Kevin, do you have anything to add here, as one of the guys knowing the math > stuff in the Tcl core better than most ? Nothing you didn't already say. Inf and -Inf are parsed as floating point numbers. -- 73 de ke9tv/2, Kevin |