mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/bigdecimal/bigdecimal.c (BigDecimal_to_f): use strtod() for more precision. [ruby-talk:290296] * ext/bigdecimal/bigdecimal.c (BASE_FIG): made constant. * ext/bigdecimal/extconf.rb: ditto. [ruby-dev:33658] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@17131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
12 lines
318 B
Ruby
12 lines
318 B
Ruby
require 'mkmf'
|
|
|
|
base_fig = 0
|
|
src = ("(BASE > 0) && "
|
|
"(BASE * (BASE+1)) > BASE && "
|
|
"(BASE * (BASE+1)) / BASE == (BASE+1)")
|
|
while try_static_assert(src, nil, "-DBASE=10#{'0'*base_fig}UL")
|
|
base_fig += 1
|
|
end
|
|
$defs << "-DBASE=1#{'0'*base_fig}UL" << "-DBASE_FIG=#{base_fig}"
|
|
|
|
create_makefile('bigdecimal')
|