#159: "%d" with large integer argument gives conversion error
---------------------------------+------------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: [EMAIL PROTECTED]
Type: defect | Status: new
Priority: major | Milestone:
Component: MacRuby | Resolution:
Keywords: |
---------------------------------+------------------------------------------
Comment(by [EMAIL PROTECTED]):
At a glance it looks like the problem is in the way we convert the
argument to a C_INT type, to pass to the CFStringCreateWithFormat
function, in the objc.m file - rb_str_format().
Instead of trying to convert big fixnums or bignums to C_INT we should
instead take a different code path and print every digit out of the
numeric type.
This easily reproduces when trying to print a bignum:
{{{
$ ./miniruby -e "p '%d' % (42**12)"
-e:1:in `%': bignum too big to convert into `long' (RangeError)
from -e:1:in `<main>'
$
}}}
(sprintf.c is mostly unused in MacRuby, because we rely on CF for this.)
--
Ticket URL: <http://www.macruby.org/trac/ticket/159#comment:1>
MacRuby <http://macruby.org/>
_______________________________________________
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel