Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #40863] [TODO] Tcl - Actually support bignums

4 views
Skip to first unread message

Matt Diephouse

unread,
Nov 13, 2006, 1:30:35 PM11/13/06
to bugs-bi...@rt.perl.org
# New Ticket Created by Matt Diephouse
# Please include the string: [perl #40863]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=40863 >


Tcl currently has this code in pge2past.tg:

$S0 = node['decimal']
$I0 = length $S0
if $I0 < 10 goto decimal
if $I0 > 10 goto bignum_hack

if $S0 >= "2147483647" goto bignum_hack

decimal:
$S0 = node
past['value'] = $S0
past['class'] = "TclInt"
.return (past)

bignum_hack:
past['value'] = 0
past['class'] = "TclInt"
.return(past)

This checks if the value is too big to be represented by a normal
integer. If it is, then it sets the value to zero. This makes any
tests fail, but it makes them at least compile. It shouldn't be too
much harder to make numbers promote properly.

--
Matt Diephouse

0 new messages