For Programmers: Free Programming Magazines  


Home > Archive > Tcl > March 2006 > tcl-math(8.5): big-doubles? how do you do it?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author tcl-math(8.5): big-doubles? how do you do it?
Andreas Leitgeb

2006-03-31, 7:03 pm

The range of doubles goes up to about 1e308.
Still, expr {sqrt(10**600)} correctly gives me 1e+300.
How does it handle the too-large-for-double argument?

Just curious.
suchenwi

2006-03-31, 7:03 pm

10*600 is a bigint, which has hardly any limit :)

Don Porter

2006-03-31, 7:03 pm

Andreas Leitgeb wrote:
> The range of doubles goes up to about 1e308.
> Still, expr {sqrt(10**600)} correctly gives me 1e+300.
> How does it handle the too-large-for-double argument?


Use the Source, Luke. :^)

ExprSqrtFunc() is in tclBasic.c, and I don't think it's too
tricky to follow.

--
| Don Porter Mathematical and Computational Sciences Division |
| donald.porter@nist.gov Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|_______________________________________
_______________________________|
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com