From: Uwe Klein on
Hello everybody.

I have a nagging problem with handling
an "infinite" results:

set test [ expr -inf ] ;# works ok
set test [ expr +inf ] ;# errors out

why the difference?

if {$test == -inf} {puts infinite} ,# works too

format "_% 8.2f_" 122.33
--> _ 122.33_

format "_% 8.2f_" $test ;# works adequately
--> _ -inf_

I have some collision computation that will
return "infinite as a result for "no collision".

Unfortunately it looks like i have to trap this special
case at all computanional levels.

Any good ideas to work around this?




From: Don Porter on
Uwe Klein wrote:
> set test [ expr -inf ] ;# works ok
> set test [ expr +inf ] ;# errors out
....
> Any good ideas to work around this?

Stop using Tcl 8.4 and earlier.

--
| Don Porter Mathematical and Computational Sciences Division |
| donald.porter(a)nist.gov Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|
From: Uwe Klein on
Don Porter wrote:
> Uwe Klein wrote:
>
>> set test [ expr -inf ] ;# works ok
>> set test [ expr +inf ] ;# errors out
>
> ...
>
>> Any good ideas to work around this?
>
>
> Stop using Tcl 8.4 and earlier.
>
Duh, thanks.

My target is 8.5, but my devel system is "not current".
Another reason to fix that.


uwe
From: Bruce Hartweg on
Uwe Klein wrote:
> Hello everybody.
>
> I have a nagging problem with handling
> an "infinite" results:
>
> set test [ expr -inf ] ;# works ok
> set test [ expr +inf ] ;# errors out
>
> why the difference?
>
what version/platform?

these both work the same for me on Solaris and Tcl 8.4.4

bruce
From: Uwe Klein on
Bruce Hartweg wrote:
> Uwe Klein wrote:
>
>> Hello everybody.
>>
>> I have a nagging problem with handling
>> an "infinite" results:
>>
>> set test [ expr -inf ] ;# works ok
>> set test [ expr +inf ] ;# errors out
>>
>> why the difference?
>>
> what version/platform?
>
> these both work the same for me on Solaris and Tcl 8.4.4
>
> bruce
tcl-8.4.6 ( thats strange, isn't it?)

The target system is at tcl-8.5.7

uwe