1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext/bigdecimal/extconf.rb
shyouhei 5ecf4d8af3 merge revision(s) 15415:
* 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
2008-06-13 03:07:43 +00:00

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')