diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-09 08:51:26 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-09 08:51:26 +0000 |
commit | a424741c8e73bbca5d893594abbdfda489794739 (patch) | |
tree | e17d97a861721f05bf0a197650fa814462854253 /ext/bigdecimal/extconf.rb | |
parent | 0e66903fca6743ab09504a5b9bd711c6d99821fb (diff) | |
download | ruby-a424741c8e73bbca5d893594abbdfda489794739.tar.gz |
* 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/trunk@15415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal/extconf.rb')
-rw-r--r-- | ext/bigdecimal/extconf.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/bigdecimal/extconf.rb b/ext/bigdecimal/extconf.rb index a68a656044..864aaad862 100644 --- a/ext/bigdecimal/extconf.rb +++ b/ext/bigdecimal/extconf.rb @@ -1,2 +1,12 @@ 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') |