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/bigdecimal_ja.html

811 lines
29 KiB
HTML
Raw Normal View History

<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=Shift_JIS">
<style type="text/css"><!--
body { color: #3f0f0f; background: #fefeff; margin-left: 2em; margin-right: 2em;}
h1 { color: #ffffff; background-color: #3939AD; border-color: #FF00FF; width: 100%;
border-style: solid; border-top-width: 0.1em; border-bottom-width: 0.1em; border-right: none;
border-left: none; padding: 0.1em; font-weight: bold; font-size: 160%; text-align: center;
}
h2 { color: #00007f; background-color: #e7e7ff; border-color: #000094; width: 100%;
border-style: solid; border-left: none; border-right: none; border-top-width: 0.1em; border-bottom-width: 0.1em;
padding: 0.1em;
font-weight: bold; font-size: 110%;
}
h3 { color: #00007f; padding: 0.2em; font-size: 110%;}
h4, h5 { color: #000000; padding: 0.2em; font-size: 100%;}
table { margin-top: 0.2em; margin-bottom: 0.2em; margin-left: 2em; margin-right: 2em;}
caption { color: #7f0000; font-weight: bold;}
th { background: #e7e7ff; padding-left: 0.2em; padding-right: 0.2em;}
td { background: #f3f7ff; padding-left: 0.2em; padding-right: 0.2em;}
code { color: #0000df;}
dt { margin-top: 0.2em;}
li { margin-top: 0.2em;}
pre
{ BACKGROUND-COLOR: #d0d0d0; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none;
BORDER-RIGHT: medium none; BORDER-TOP: medium none; LINE-HEIGHT: 100%; MARGIN: 12px 12px 12px 12px;
PADDING-BOTTOM: 12px; PADDING-LEFT: 12px; PADDING-RIGHT: 12px; PADDING-TOP: 12px;
WHITE-SPACE: pre; WIDTH: 100%
}
--></style>
<TITLE>BigDecimal:An extension library for Ruby</TITLE>
</HEAD>
<BODY BGCOLOR=#FFFFE0>
<H1>BigDecimal(<28>•ϒ<C295><CF92><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD><5F><EFBFBD>Z<EFBFBD>p<EFBFBD>g<EFBFBD><67><EFBFBD><EFBFBD><EFBFBD>C<EFBFBD>u<EFBFBD><75><EFBFBD><EFBFBD>)</H1>
<DIV align="right"><A HREF="./bigdecimal_en.html">English</A></DIV><BR>
BigDecimal <20>̓I<CD83>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD>w<EFBFBD><77><EFBFBD>̋<EFBFBD><CC8B>͂ȃX<C883>N<EFBFBD><4E><EFBFBD>v<EFBFBD>g<EFBFBD><67><EFBFBD><EFBFBD><EFBFBD>ł<EFBFBD><C582><EFBFBD> Ruby <20>ɉ•ϒ<C295><CF92><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>_
<EFBFBD>v<EFBFBD>Z<EFBFBD>@<40>\<5C><><EFBFBD>lj<EFBFBD><C789><EFBFBD><EFBFBD><EFBFBD>߂̊g<CC8A><67><EFBFBD><EFBFBD><EFBFBD>C<EFBFBD>u<EFBFBD><75><EFBFBD><EFBFBD><EFBFBD>ł<EFBFBD><C582>B
Ruby <20>ɂ‚<C982><C282>Ă̏ڂ<CC8F><DA82><EFBFBD><EFBFBD><EFBFBD><EFBFBD>e<EFBFBD>͈ȉ<CD88><C889><EFBFBD>URL<52><4C><EFBFBD>Q<EFBFBD>Ƃ<EFBFBD><C682>Ă<EFBFBD><C482><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>B
<UL>
<LI><A HREF="http://www.ruby-lang.org/ja/">http://www.ruby-lang.org/ja/</A><EFBFBD>FRuby<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>y<EFBFBD>[<5B>W</LI>
<LI><A HREF="http://kahori.com/ruby/ring/">http://kahori.com/ruby/ring/</A><EFBFBD>FRuby<EFBFBD>Ɋւ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>y<EFBFBD>[<5B>W<EFBFBD><57><EFBFBD>H<EFBFBD><48><EFBFBD>܂<EFBFBD></LI>
</UL>
<hr>
<H2><EFBFBD>ڎ<EFBFBD></H2>
<UL>
<LI><A HREF="#INTRO"><EFBFBD>͂<EFBFBD><EFBFBD>߂<EFBFBD></LI>
<LI><A HREF="#SPEC"><EFBFBD>g<EFBFBD>p<EFBFBD><EFBFBD><EFBFBD>@<40>ƃ<EFBFBD><C683>\<5C>b<EFBFBD>h<EFBFBD>̈ꗗ</A></LI>
<LI><A HREF="#UNDEF"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD>񐔁A<EFBFBD>[<5B><><EFBFBD>̈<EFBFBD><CC88><EFBFBD></A></LI>
<LI><A HREF="#STRUCT"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\<5C><></A></LI>
<LI><A HREF="#BASE">2<EFBFBD>i<EFBFBD><EFBFBD>10<EFBFBD>i</A></LI>
<LI><A HREF="#PREC"><EFBFBD>v<EFBFBD>Z<EFBFBD><EFBFBD><EFBFBD>x<EFBFBD>ɂ‚<EFBFBD><EFBFBD><EFBFBD></A></LI>
</UL>
<HR>
<A NAME="#INTRO">
<H2><EFBFBD>͂<EFBFBD><EFBFBD>߂<EFBFBD></H2>
Ruby <20>ɂ<EFBFBD> Bignum <20>Ƃ<EFBFBD><C682><EFBFBD><EFBFBD>N<EFBFBD><4E><EFBFBD>X<EFBFBD><58><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD><41><EFBFBD>S<EFBFBD><53><EFBFBD>̐<EFBFBD><CC90><EFBFBD><EFBFBD>ł<EFBFBD><C582>v<EFBFBD>Z<EFBFBD><5A><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682>ł<EFBFBD><C582>܂<EFBFBD><DC82>B
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD>C<EFBFBD>ӌ<EFBFBD><EFBFBD>̕<EFBFBD><EFBFBD><EFBFBD><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BD>
<EFBFBD>͂ł<EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD><EFBFBD><EFBFBD>B<EFBFBD>܂<EFBFBD><EFBFBD>A<EFBFBD><EFBFBD><EFBFBD>ʂɂ‚<EFBFBD><EFBFBD>Ă<EFBFBD><EFBFBD>ۏ؂ł<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̂ł͂<EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD><EFBFBD><EFBFBD>B
<EFBFBD>\<5C>߁A<DF81><41><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>B
<BR><BR>
<EFBFBD><EFBFBD><EFBFBD>̃v<EFBFBD><EFBFBD><EFBFBD>O<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>́A<EFBFBD><EFBFBD><EFBFBD>R<EFBFBD>ɔz<EFBFBD>z<EFBFBD>E<EFBFBD><EFBFBD><EFBFBD>ς<EFBFBD><EFBFBD>č\<5C><><EFBFBD>܂<EFBFBD><DC82><EFBFBD><EFBFBD>B<EFBFBD><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD><41><EFBFBD><EFBFBD>͕<EFBFBD><CD95><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ă<EFBFBD><C482>܂<EFBFBD><DC82><EFBFBD><EFBFBD>B
<EFBFBD>z<EFBFBD>z<EFBFBD>E<EFBFBD><EFBFBD><EFBFBD>ϓ<EFBFBD><EFBFBD>̌<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ruby <20>̂<EFBFBD><CC82><EFBFBD><EFBFBD>ɏ<EFBFBD><C98F><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B<EFBFBD>ڂ<EFBFBD><DA82><EFBFBD><EFBFBD><EFBFBD> README <20><><EFBFBD>ǂ<EFBFBD><C782>ł<EFBFBD><C582><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>B
<hr>
<H2><EFBFBD>C<EFBFBD><EFBFBD><EFBFBD>X<EFBFBD>g<EFBFBD>[<5B><><EFBFBD>ɂ‚<C982><C282><EFBFBD></H2>
BigDecimal <20><><EFBFBD>܂<EFBFBD> Ruby <20>̍ŐV<C590>ł<EFBFBD><A HREF="http://www.ruby-lang.org/ja/">Ruby<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>y<EFBFBD>[<5B>W</A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD>E<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>[<5B>h<EFBFBD>ł<EFBFBD><C582>܂<EFBFBD><DC82>B
<EFBFBD>_<EFBFBD>E<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>[<5B>h<EFBFBD><68><EFBFBD><EFBFBD><EFBFBD>ŐV<C590>ł<EFBFBD><C582>𓀂<EFBFBD><F0938082><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD>ʏ<EFBFBD><CA8F>̃C<CC83><43><EFBFBD>X<EFBFBD>g<EFBFBD>[<5B><><EFBFBD><EFBFBD><E88F87><EFBFBD><EFBFBD><EFBFBD>s<EFBFBD><73><EFBFBD>ĉ<EFBFBD><C489><EFBFBD><EFBFBD><EFBFBD><EFBFBD>B
Ruby <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>C<EFBFBD><43><EFBFBD>X<EFBFBD>g<EFBFBD>[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>΁A<CE81><41><EFBFBD><EFBFBD><EFBFBD><EFBFBD> BigDecimal <20><><EFBFBD><EFBFBD><EFBFBD>p<EFBFBD>ł<EFBFBD><C582><EFBFBD><EFBFBD><EFBFBD>ɂȂ<C982><C882>͂<EFBFBD><CD82>ł<EFBFBD><C582>B
<EFBFBD>\<5C>[<5B>X<EFBFBD>t<EFBFBD>@<40>C<EFBFBD><43><EFBFBD><EFBFBD>
bigdecimal.c,bigdecimal.h
<EFBFBD>̂Q<EFBFBD>‚݂̂ł<EFBFBD><EFBFBD>B<BR>
<hr>
<A NAME="#SPEC">
<H2><EFBFBD>g<EFBFBD>p<EFBFBD><EFBFBD><EFBFBD>@<40>ƃ<EFBFBD><C683>\<5C>b<EFBFBD>h<EFBFBD>̈ꗗ</H2>
<EFBFBD>uRuby<EFBFBD>͊<EFBFBD><EFBFBD>ɏ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>v<EFBFBD>Ƃ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>O<EFBFBD><EFBFBD><EFBFBD>ŁA
<CODE><PRE>
require 'bigdecimal'
a=BigDecimal::new("0.123456789123456789")
b=BigDecimal("123456.78912345678",40)
c=a+b
</PRE></CODE>
<br>
<EFBFBD>Ƃ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȋ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŏg<EFBFBD>p<EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B
<H3><EFBFBD><EFBFBD><EFBFBD>\<5C>b<EFBFBD>h<EFBFBD></H3>
<EFBFBD>ȉ<EFBFBD><EFBFBD>̃<EFBFBD><EFBFBD>\<5C>b<EFBFBD>h<EFBFBD><68><EFBFBD><EFBFBD><EFBFBD>p<EFBFBD>”\<5C>ł<EFBFBD><C582>B
<EFBFBD>u<EFBFBD>L<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>v<EFBFBD>Ƃ<EFBFBD> BigDecimal <20><><EFBFBD><EFBFBD><EFBFBD>x<EFBFBD><78><EFBFBD>ۏ؂<DB8F><D882><EFBFBD><E98C85><EFBFBD>ł<EFBFBD><C582>B
<EFBFBD>҂<EFBFBD><EFB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΁A<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>񂩂<EFBFBD> BigDecimal <20>ւ<EFBFBD>
<EFBFBD>ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>A"0.xxxxxEn" <20>Ƃ<EFBFBD><C682><EFBFBD><EFBFBD>`<60><><EFBFBD>ł͂Ȃ<CD82> "nnnnn.mmmm" <20>̌`<60><><EFBFBD>̕<EFBFBD><CC95><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD>֕ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\<5C>b<EFBFBD>h<EFBFBD><68><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B<EFBFBD><42><EFBFBD>p<EFBFBD><70><EFBFBD><EFBFBD><EFBFBD>ɂ<EFBFBD>
<CODE><PRE>
require "bigdecimal/util.rb"
</PRE></CODE>
<EFBFBD>̂悤<EFBFBD>ɂ<EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B<EFBFBD>ڍׂ<EFBFBD> util.rb <20>̓<EFBFBD><CC93>e<EFBFBD><65><EFBFBD>Q<EFBFBD>Ƃ<EFBFBD><C682>ĉ<EFBFBD><C489><EFBFBD><EFBFBD><EFBFBD><EFBFBD>B
<H4><U><EFBFBD>N<EFBFBD><EFBFBD><EFBFBD>X<EFBFBD><EFBFBD><EFBFBD>\<5C>b<EFBFBD>h</U></H4>
<UL>
<LI><B>new</B></LI><BLOCKQUOTE>
<EFBFBD>V<EFBFBD><EFBFBD><EFBFBD><EFBFBD> BigDecimal <20>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD>𐶐<EFBFBD><F090B690><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B<BR>
a=BigDecimal::new(s[,n]) <20>܂<EFBFBD><DC82><EFBFBD><BR>
a=BigDecimal(s[,n])<BR>
s <20>͏<EFBFBD><CD8F><EFBFBD><EFBFBD>l<EFBFBD>𕶎<EFBFBD><F095B68E><EFBFBD><EFBFBD>Ŏw<C58E><EFBFBD>܂<EFBFBD><DC82>D
n <20>͕K<CD95>v<EFBFBD>ȗL<C897><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ia <20>̍ő<CC8D><C591>L<EFBFBD><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>j<EFBFBD>𐮐<EFBFBD><F090AE90>Ŏw<C58E><EFBFBD>܂<EFBFBD><DC82>B
n <20><> 0 <20>܂<EFBFBD><DC82>͏ȗ<CD8F><C897><EFBFBD><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682>́An <20>̒l<CC92><6C> s <20>̗L<CC97><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƃ݂Ȃ<DD82><C882><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
s <20>̗L<CC97><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> n <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682><EFBFBD> n=0 <20>̂Ƃ<CC82><C682>Ɠ<EFBFBD><C693><EFBFBD><EFBFBD>ł<EFBFBD><C582>B
a <20>̍ő<CC8D><C591>L<EFBFBD><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> n <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>l<EFBFBD><6C><EFBFBD>̗p<CC97><70><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
<EFBFBD>ő<EFBFBD><EFBFBD>L<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͈ȉ<EFBFBD><EFBFBD>̂悤<EFBFBD>Ȋ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Z<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>s<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƃ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɈӖ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B
<CODE><PRE>
BigDecimal("1") / BigDecimal("3") # => 0.3333333333 33E0
BigDecimal("1",10) / BigDecimal("3",10) # => 0.3333333333 3333333333 33333333E0
</PRE></CODE>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD>X<EFBFBD>̉<EFBFBD><EFBFBD>Z<EFBFBD>ɂ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ő<EFBFBD><EFBFBD>L<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> n <20>̎<EFBFBD><CC8E><EFBFBD><E888B5><EFBFBD>͏<EFBFBD><CD8F><EFBFBD><EFBFBD>̃o<CC83>[<5B>W<EFBFBD><57><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD>ύX<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>”\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
</BLOCKQUOTE>
<LI><B>mode</B></LI><BLOCKQUOTE>
BigDecimal<EFBFBD>̎<EFBFBD><EFBFBD>s<EFBFBD><EFBFBD><EFBFBD>ʂ𐧌䂵<EFBFBD>܂<EFBFBD><EFBFBD>B<EFBFBD>ȉ<EFBFBD><EFBFBD>̎g<EFBFBD>p<EFBFBD><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD><EFBFBD>`<60><><EFBFBD><EFBFBD><EFBFBD>Ă<EFBFBD><C482>܂<EFBFBD><DC82>B
<P>
<B>[<5B><><EFBFBD>O<EFBFBD><4F><EFBFBD><EFBFBD>]</B><P>
<EFBFBD>v<EFBFBD>Z<EFBFBD><EFBFBD><EFBFBD>ʂ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(NaN)<29><><EFBFBD>[<5B><><EFBFBD>ɂ<EFBFBD><C982><EFBFBD>Z<EFBFBD>ɂȂ<C982><C882><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682>̏<EFBFBD><CC8F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>`<60><><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682>ł<EFBFBD><C582>܂<EFBFBD><DC82>B
<BLOCKQUOTE>
f = BigDecimal::mode(BigDecimal::EXCEPTION_NaN,flag)<BR>
f = BigDecimal::mode(BigDecimal::EXCEPTION_INFINITY,flag)<BR>
f = BigDecimal::mode(BigDecimal::EXCEPTION_UNDERFLOW,flag)<BR>
f = BigDecimal::mode(BigDecimal::EXCEPTION_OVERFLOW,flag)<BR>
f = BigDecimal::mode(BigDecimal::EXCEPTION_ZERODIVIDE,flag)<BR>
f = BigDecimal::mode(BigDecimal::EXCEPTION_ALL,flag)<BR>
</BLOCKQUOTE>
EXCEPTION_NaN <20>͌<EFBFBD><CD8C>ʂ<EFBFBD> NaN <20>ɂȂ<C982><C882><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682>̎w<CC8E><77><EFBFBD>ł<EFBFBD><C582>B<BR>
EXCEPTION_INFINITY <20>͌<EFBFBD><CD8C>ʂ<EFBFBD><CA82><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28>}Infinity)<29>ɂȂ<C982><C882><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682>̎w<CC8E><77><EFBFBD>ł<EFBFBD><C582>B<BR>
EXCEPTION_UNDERFLOW <20>͎w<CD8E><77><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD><41><EFBFBD>_<EFBFBD>[<5B>t<EFBFBD><74><EFBFBD>[<5B><><EFBFBD><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682>̎w<CC8E><77><EFBFBD>ł<EFBFBD><C582>B<BR>
EXCEPTION_OVERFLOW <20>͎w<CD8E><77><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>I<EFBFBD>[<5B>o<EFBFBD>[<5B>t<EFBFBD><74><EFBFBD>[<5B><><EFBFBD><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682>̎w<CC8E><77><EFBFBD>ł<EFBFBD><C582>B<BR>
EXCEPTION_ZERODIVIDE <20>̓[<5B><><EFBFBD>ɂ<EFBFBD><C982><EFBFBD><E98A84><EFBFBD>Z<EFBFBD><5A><EFBFBD><EFBFBD><EFBFBD>s<EFBFBD><73><EFBFBD><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682>̎w<CC8E><77><EFBFBD>ł<EFBFBD><C582>B<BR>
EXCEPTION_ALL <20>́A<CD81>”\<5C>ȑS<C891>Ăɑ΂<C991><CE82>Ĉꊇ<C488><EA8A87><EFBFBD>Đݒ肷<DD92><E882B7><EFBFBD>Ƃ<EFBFBD><C682>Ɏg<C98E>p<EFBFBD><70><EFBFBD>܂<EFBFBD><DC82>B<BR><BR>
flag <20><> true <20>̂Ƃ<CC82><C682>́A<CD81>w<EFBFBD><EFBFBD><E882B5><EFBFBD><EFBFBD><EFBFBD>ԂɂȂ<C982><C882><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682>ɗ<EFBFBD><C997>O<EFBFBD>𔭍s<F094AD8D><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɂȂ<C982><C882>܂<EFBFBD><DC82>B<BR>
flag <20><> false<73>i<EFBFBD>f<EFBFBD>t<EFBFBD>H<EFBFBD><48><EFBFBD>g<EFBFBD>j<EFBFBD>Ȃ<EFBFBD><C882>A<EFBFBD><41><EFBFBD>O<EFBFBD>͔<EFBFBD><CD94>s<EFBFBD><73><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82><EFBFBD><EFBFBD>B<EFBFBD>v<EFBFBD>Z<EFBFBD><5A><EFBFBD>ʂ͈ȉ<CD88><C889>̂悤<CC82>ɂȂ<C982><C882>܂<EFBFBD><DC82>B<BR>
<BLOCKQUOTE>
EXCEPTION_NaN <20>̂Ƃ<CC82><C682>A<EFBFBD><41><EFBFBD><EFBFBD>(NaN)<BR>
EXCEPTION_INFINITY <20>̂Ƃ<CC82><C682>A<EFBFBD><41><EFBFBD><EFBFBD>(+ or -Infinity)<BR>
EXCEPTION_UNDERFLOW <20>̂Ƃ<CC82><C682>A<EFBFBD>[<5B><><BR>
EXCEPTION_OVERFLOW <20>̂Ƃ<CC82><C682>A+Infinity <20><> -Infinity<BR>
EXCEPTION_ZERODIVIDE <20>̂Ƃ<CC82><C682>A+Infinity <20><> -Infinity<BR>
</BLOCKQUOTE>
EXCEPTION_INFINITY<EFBFBD>AEXCEPTION_OVERFLOW<EFBFBD>AEXCEPTION_ZERODIVIDE
<EFBFBD>͍<EFBFBD><EFBFBD>̂Ƃ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ł<EFBFBD><EFBFBD>B<BR>
<EFBFBD>߂<EFBFBD><EFBFBD>l<EFBFBD>́A<EFBFBD>ݒ<EFBFBD><EFBFBD>O<EFBFBD>̒l<EFBFBD>ł<EFBFBD><EFBFBD>B<EFBFBD>u<EFBFBD>l<EFBFBD>v<EFBFBD>̈Ӗ<EFBFBD><EFBFBD>́A<EFBFBD><EFBFBD><EFBFBD>
BigDecimal::EXCEPTION_NaN<61>Ɓu<C681>l<EFBFBD>v<EFBFBD><76> & <20><> <20>[<5B><><EFBFBD>ȊO<C88A>Ȃ<EFBFBD><C882><EFBFBD>
EXCEPTION_NaN<EFBFBD><EFBFBD><EFBFBD>ݒ肳<EFBFBD><EFBFBD><EFBFBD>Ă<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƃ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӗ<EFBFBD><EFBFBD>ł<EFBFBD><EFBFBD>B<BR>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɐ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȃ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>̂<EFBFBD><EFBFBD>w<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> nil <20><><EFBFBD>Ԃ<EFBFBD><D482>܂<EFBFBD><DC82>B
<P>
<B>[<5B>ۂߏ<DB82><DF8F><EFBFBD><EFBFBD>w<EFBFBD><77>]</B><P>
<EFBFBD>v<EFBFBD>Z<EFBFBD>r<EFBFBD><EFBFBD><EFBFBD>̊ۂߑ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>̎w<EFBFBD><EFBFBD>ł<EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B
<BLOCKQUOTE>
f = BigDecimal::mode(BigDecimal::COMP_MODE,flag)
</BLOCKQUOTE>
<EFBFBD>̌`<60><><EFBFBD>Ŏw<C58E><EFBFBD>܂<EFBFBD><DC82>B<BR>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŁAflag <20>͈ȉ<CD88>(<28><><EFBFBD>ʓ<EFBFBD><CA93>͑Ή<CD91><CE89><EFBFBD><EFBFBD><EFBFBD><EFBFBD>C<EFBFBD><43><EFBFBD>X<EFBFBD>^<5E><><EFBFBD>X<EFBFBD><58><EFBFBD>\<5C>b<EFBFBD>h)<29>̈<EFBFBD><CC88>‚<EFBFBD><C282>w<EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
<TABLE>
<TR><TD>COMP_MODE_TRUNCATE</TD><TD><EFBFBD>S<EFBFBD>Đ؂<EFBFBD><EFBFBD>̂Ă܂<EFBFBD>(truncate)<29>B</TD></TR>
<TR><TD>COMP_MODE_ROUND</TD><TD><EFBFBD>l<EFBFBD>̌ܓ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD>(round<6E>A<EFBFBD>f<EFBFBD>t<EFBFBD>H<EFBFBD><48><EFBFBD>g)<29>B</TD></TR>
<TR><TD>COMP_MODE_CEIL</TD><TD><EFBFBD><EFBFBD><EFBFBD>l<EFBFBD>̑傫<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɌJ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD>(ceil)<29>B</TD></TR>
<TR><TD>COMP_MODE_FLOOR</TD><TD><EFBFBD><EFBFBD><EFBFBD>l<EFBFBD>̏<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɌJ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD>(floor)<29>B</TD></TR>
<TR><TD>COMP_MODE_EVEN</TD><TD><EFBFBD>l<EFBFBD>̘Z<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B<EFBFBD>T<EFBFBD>̎<EFBFBD><EFBFBD>͏<EFBFBD><EFBFBD>ʂP<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̎<EFBFBD><EFBFBD>̂݌J<EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD>(Banker's rounding)<29>B</TD></TR>
</TABLE>
<EFBFBD>߂<EFBFBD><EFBFBD>l<EFBFBD>͎w<EFBFBD><EFBFBD><EFBFBD>O<EFBFBD><EFBFBD> flag <20>̒l<CC92>ł<EFBFBD><C582>B
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɐ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȃ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>̂<EFBFBD><EFBFBD>w<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> nil <20><><EFBFBD>Ԃ<EFBFBD><D482>܂<EFBFBD><DC82>B<BR>
mode <20><><EFBFBD>\<5C>b<EFBFBD>h<EFBFBD>ł͊ۂߑ<DB82><DF91><EFBFBD><EFBFBD>̈ʒu<CA92><75><EFBFBD><EFBFBD><EFBFBD>[<5B>U<EFBFBD><55><EFBFBD>w<EFBFBD><EFBFBD><EFBFBD>Ƃ͂ł<CD82><C582>܂<EFBFBD><DC82><EFBFBD><EFBFBD>B
<EFBFBD>ۂߑ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƈʒu<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ő<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> truncate/round/ceil/floor <20><>
add/sub/mult <20>Ƃ<EFBFBD><C682><EFBFBD><EFBFBD><EFBFBD><EFBFBD>C<EFBFBD><43><EFBFBD>X<EFBFBD>^<5E><><EFBFBD>X<EFBFBD><58><EFBFBD>\<5C>b<EFBFBD>h<EFBFBD><68><EFBFBD>g<EFBFBD>p<EFBFBD><70><EFBFBD>ĉ<EFBFBD><C489><EFBFBD><EFBFBD><EFBFBD><EFBFBD>B
</BLOCKQUOTE>
<LI><B>limit([n])</B></LI><BLOCKQUOTE>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>BigDecimal<EFBFBD>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD>̍ő包<EFBFBD><EFBFBD><EFBFBD><EFBFBD>n<EFBFBD><EFBFBD><EFBFBD>ɐ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B
<EFBFBD>߂<EFBFBD><EFBFBD>l<EFBFBD>͐ݒ肷<EFBFBD><EFBFBD><EFBFBD>O<EFBFBD>̒l<EFBFBD>ł<EFBFBD><EFBFBD>B<EFBFBD>ݒ<EFBFBD><EFBFBD>l<EFBFBD>̃f<EFBFBD>t<E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FBFBD><EFBFBD><EFBFBD><E582AB>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>m<EFBFBD>ۂ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B<EFBFBD>܂<EFBFBD><EFBFBD>Alimit <20>ɂ<EFBFBD><C982><EFBFBD><E98C85><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<29>A
<EFBFBD>C<EFBFBD><EFBFBD><EFBFBD>X<EFBFBD>^<5E><><EFBFBD>X<EFBFBD><58><EFBFBD>\<5C>b<EFBFBD>h (truncate/round/ceil/floor/add/sub/mult) <20><><EFBFBD><EFBFBD>
<EFBFBD>D<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̂Œ<EFBFBD><EFBFBD>ӂ<EFBFBD><EFBFBD>K<EFBFBD>v<EFBFBD>ł<EFBFBD><EFBFBD>B<BR>
mf = BigDecimal::limit(n)<BR>
</BLOCKQUOTE>
<LI><B>double_fig</B></LI><BLOCKQUOTE>
Ruby <20><> Float <20>N<EFBFBD><4E><EFBFBD>X<EFBFBD><58><EFBFBD>ێ<EFBFBD><DB8E>ł<EFBFBD><C582><EFBFBD><EFBFBD>L<EFBFBD><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̐<EFBFBD><CC90><EFBFBD><EFBFBD>Ԃ<EFBFBD><D482>܂<EFBFBD><DC82>B
<CODE><PRE>
p BigDecimal::double_fig # ==> 20 (depends on the CPU etc.)
</PRE></CODE>
double_fig<EFBFBD>͈ȉ<EFBFBD><EFBFBD><EFBFBD> C <20>v<EFBFBD><76><EFBFBD>O<EFBFBD><4F><EFBFBD><EFBFBD><EFBFBD>̌<EFBFBD><CC8C>ʂƓ<CA82><C693><EFBFBD><EFBFBD>ł<EFBFBD><C582>B
<CODE><PRE>
double v = 1.0;
int double_fig = 0;
while(v + 1.0 > 1.0) {
++double_fig;
v /= 10;
}
</PRE></CODE>
</BLOCKQUOTE>
<LI><B>BASE</B></LI><BLOCKQUOTE>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŏg<EFBFBD>p<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̒l<EFBFBD>ł<EFBFBD><EFBFBD>B<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 32 <20>r<EFBFBD>b<EFBFBD>g<EFBFBD>̏<EFBFBD><CC8F><EFBFBD><EFBFBD>n<EFBFBD>ł<EFBFBD>10000<30>ł<EFBFBD><C582>B<BR>
b = BigDecimal::BASE<BR>
</BLOCKQUOTE>
</UL>
<H4><U><EFBFBD>C<EFBFBD><EFBFBD><EFBFBD>X<EFBFBD>^<5E><><EFBFBD>X<EFBFBD><58><EFBFBD>\<5C>b<EFBFBD>h</U></H4>
<UL>
<LI><B>+</B></LI><BLOCKQUOTE>
<EFBFBD><EFBFBD><EFBFBD>Z<EFBFBD>ic = a + b<>j<BR>
c <20>̐<EFBFBD><CC90>x<EFBFBD>ɂ‚<C982><C282>Ắu<A HREF="#PREC"><EFBFBD>v<EFBFBD>Z<EFBFBD><EFBFBD><EFBFBD>x<EFBFBD>ɂ‚<EFBFBD><EFBFBD><EFBFBD></A><EFBFBD>v<EFBFBD><EFBFBD><EFBFBD>Q<EFBFBD>Ƃ<EFBFBD><EFBFBD>Ă<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>B
</BLOCKQUOTE>
<LI><B>-</B></LI><BLOCKQUOTE>
<EFBFBD><EFBFBD><EFBFBD>Z<EFBFBD>ic = a - b<>j<EFBFBD>A<EFBFBD>܂<EFBFBD><DC82>͕<EFBFBD><CD95><EFBFB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BFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>B
</BLOCKQUOTE>
<LI><B>add</B></LI><BLOCKQUOTE>
<EFBFBD>ȉ<EFBFBD><EFBFBD>̂悤<EFBFBD>Ɏg<EFBFBD>p<EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B<BR>
c = a.add(b,n)<BR>
c = a + b <20><><EFBFBD>ő<EFBFBD><C591><EFBFBD> n <20><><EFBFBD>܂Ōv<C58C>Z<EFBFBD><5A><EFBFBD>܂<EFBFBD><DC82>B
a + b <20>̐<EFBFBD><CC90>x<EFBFBD><78> n <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E582AB><EFBFBD>Ƃ<EFBFBD><C682><EFBFBD> BigDecimal.mode <20>Ŏw<C58E><EFBFBD><EFBFBD><EA82BD><EFBFBD>@<40>Ŋۂ߂<DB82><DF82><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
</BLOCKQUOTE>
<LI><B>sub</B></LI><BLOCKQUOTE>
<EFBFBD>ȉ<EFBFBD><EFBFBD>̂悤<EFBFBD>Ɏg<EFBFBD>p<EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B<BR>
c = a.sub(b,n)<BR>
c = a - b <20><><EFBFBD>ő<EFBFBD><C591><EFBFBD> n <20><><EFBFBD>܂Ōv<C58C>Z<EFBFBD><5A><EFBFBD>܂<EFBFBD><DC82>B
a - b <20>̐<EFBFBD><CC90>x<EFBFBD><78> n <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E582AB><EFBFBD>Ƃ<EFBFBD><C682><EFBFBD> BigDecimal.mode <20>Ŏw<C58E><EFBFBD><EFBFBD><EA82BD><EFBFBD>@<40>Ŋۂ߂<DB82><DF82><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
</BLOCKQUOTE>
<LI><B>mult</B></LI><BLOCKQUOTE>
<EFBFBD>ȉ<EFBFBD><EFBFBD>̂悤<EFBFBD>Ɏg<EFBFBD>p<EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B<BR>
c = a.mult(b,n)<BR>
c = a * b <20><><EFBFBD>ő<EFBFBD><C591><EFBFBD> n <20><><EFBFBD>܂Ōv<C58C>Z<EFBFBD><5A><EFBFBD>܂<EFBFBD><DC82>B
a * b <20>̐<EFBFBD><CC90>x<EFBFBD><78> n <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E582AB><EFBFBD>Ƃ<EFBFBD><C682><EFBFBD> BigDecimal.mode <20>Ŏw<C58E><EFBFBD><EFBFBD><EA82BD><EFBFBD>@<40>Ŋۂ߂<DB82><DF82><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
</BLOCKQUOTE>
<LI><B>div</B></LI><BLOCKQUOTE>
<EFBFBD>ȉ<EFBFBD><EFBFBD>̂悤<EFBFBD>Ɏg<EFBFBD>p<EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B<BR>
c = a.div(b,n)<BR>
c = a / b <20><><EFBFBD>ő<EFBFBD><C591><EFBFBD> n <20><><EFBFBD>܂Ōv<C58C>Z<EFBFBD><5A><EFBFBD>܂<EFBFBD><DC82>B
a / b <20>̐<EFBFBD><CC90>x<EFBFBD><78> n <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E582AB><EFBFBD>Ƃ<EFBFBD><C682><EFBFBD> BigDecimal.mode <20>Ŏw<C58E><EFBFBD><EFBFBD><EA82BD><EFBFBD>@<40>Ŋۂ߂<DB82><DF82><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
</BLOCKQUOTE>
<LI><B>%</B></LI><BLOCKQUOTE>
r = a%b <BR>
a/b <20>̗]<5D><><EFBFBD><EFBFBD><EFBFBD>v<EFBFBD>Z<EFBFBD><5A><EFBFBD>܂<EFBFBD><DC82>B<EFBFBD>ȉ<EFBFBD><C889>̌v<CC8C>Z<EFBFBD>Ɠ<EFBFBD><C693><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̂ł<CC82><C582>B<BR>
r = a-((a/b).floor)*b<BR>
</BLOCKQUOTE>
<LI><B>fix</B></LI><BLOCKQUOTE>
a <20>̏<EFBFBD><CC8F><EFBFBD><EFBFBD>_<EFBFBD>ȉ<EFBFBD><C889>̐؂<CC90><D882>̂āB<BR>
c = a.fix
</BLOCKQUOTE>
<LI><B>frac</B></LI><BLOCKQUOTE>
a <20>̐<EFBFBD><CC90><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̐؂<CC90><D882>̂āB<BR>
c = a.frac
</BLOCKQUOTE>
<LI><B>floor[(n)]</B></LI><BLOCKQUOTE>
c = a.floor<BR>
a <20>ȉ<EFBFBD><C889>̍ő吮<C591><E590AE><EFBFBD>iBigDecimal <20>l<EFBFBD>j<EFBFBD><6A><EFBFBD>Ԃ<EFBFBD><D482>܂<EFBFBD><DC82>B
<CODE><PRE>
c = BigDecimal("1.23456").floor # ==> 1
c = BigDecimal("-1.23456").floor # ==> -2
</PRE></CODE>
<EFBFBD>ȉ<EFBFBD><EFBFBD>̂悤<EFBFBD>Ɉ<EFBFBD><EFBFBD><EFBFBD> n <20><><EFBFBD>^<5E><><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682>ł<EFBFBD><C582>܂<EFBFBD><DC82>B<BR>
n>=0 <20>Ȃ<EFBFBD><C882>A<EFBFBD><41><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD>ȉ<EFBFBD> n+1 <20>ʂ̐<CA82><CC90><EFBFBD><EFBFBD>𑀍삵<F091808D>܂<EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD>ȉ<EFBFBD><C889><EFBFBD><EFBFBD>A<EFBFBD>ő<EFBFBD> n <20><><EFBFBD>ɂ<EFBFBD><C982>܂<EFBFBD>)<29>B<BR>
n <20><><EFBFBD><EFBFBD><EFBFBD>̂Ƃ<CC82><C682>͏<EFBFBD><CD8F><EFBFBD><EFBFBD>_<EFBFBD>ȏ<EFBFBD> n <20><><EFBFBD>ڂ𑀍삵<F091808D>܂<EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD>ʒu<CA92><75><EFBFBD><EFBFBD>ɏ<EFBFBD><C98F>Ȃ<EFBFBD><C882>Ƃ<EFBFBD> n <20>‚<EFBFBD> 0 <20><><EFBFBD><EFBFBD><EFBFBD>т܂<D182>)<29>B<BR>
<CODE><PRE>
c = BigDecimal::new("1.23456").floor(4) # ==> 1.2345
c = BigDecimal::new("15.23456").floor(-1) # ==> 10.0
</PRE></CODE>
</BLOCKQUOTE>
<LI><B>ceil[(n)]</B></LI><BLOCKQUOTE>
c = a.ceil<BR>
a <20>ȏ<EFBFBD><C88F>̐<EFBFBD><CC90><EFBFBD><EFBFBD>̂<EFBFBD><CC82><EFBFBD><EFBFBD>A<EFBFBD>ł<EFBFBD><C582><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>v<EFBFBD>Z<EFBFBD><5A><EFBFBD>A<EFBFBD><41><EFBFBD>̒l<CC92>iBigDecimal <20>l<EFBFBD>j<EFBFBD><6A><EFBFBD>Ԃ<EFBFBD><D482>܂<EFBFBD><DC82>B
<CODE><PRE>
c = BigDecimal("1.23456").ceil # ==> 2
c = BigDecimal("-1.23456").ceil # ==> -1
</PRE></CODE>
<EFBFBD>ȉ<EFBFBD><EFBFBD>̂悤<EFBFBD>Ɉ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>^<5E><><EFBFBD>āA<C481><41><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD>ȉ<EFBFBD> n+1 <20>ʂ̐<CA82><CC90><EFBFBD><EFBFBD>𑀍삷<F091808D><EFBFBD>Ƃ<EFBFBD><C682>ł<EFBFBD><C582>܂<EFBFBD><DC82>B<BR>
n>=0 <20>Ȃ<EFBFBD><C882>A<EFBFBD><41><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD>ȉ<EFBFBD> n+1 <20>ʂ̐<CA82><CC90><EFBFBD><EFBFBD>𑀍삵<F091808D>܂<EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD>ȉ<EFBFBD><C889><EFBFBD><EFBFBD>A<EFBFBD>ő<EFBFBD> n <20><><EFBFBD>ɂ<EFBFBD><C982>܂<EFBFBD>)<29>B<BR>
n <20><><EFBFBD><EFBFBD><EFBFBD>̂Ƃ<CC82><C682>͏<EFBFBD><CD8F><EFBFBD><EFBFBD>_<EFBFBD>ȏ<EFBFBD> n <20><><EFBFBD>ڂ<EFBFBD><DA82>𑀍삵<F091808D>܂<EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD>ʒu<CA92><75><EFBFBD><EFBFBD>ɏ<EFBFBD><C98F>Ȃ<EFBFBD><C882>Ƃ<EFBFBD> n <20>‚<EFBFBD> 0 <20><><EFBFBD><EFBFBD><EFBFBD>т܂<D182>)<29>B<BR>
<CODE><PRE>
c = BigDecimal::new("1.23456").ceil(4) # ==> 1.2346
c = BigDecimal::new("15.23456").ceil(-1) # ==> 20.0
</PRE></CODE>
</BLOCKQUOTE>
<LI><B>round[(n[,b])]</B></LI><BLOCKQUOTE>
c = a.round<BR>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD>ȉ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʂ̐<EFBFBD><EFBFBD><EFBFBD><EFBFBD>l<EFBFBD>̌ܓ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Đ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>iBigDecimal <20>l<EFBFBD>j<EFBFBD>ɂ<EFBFBD><C982>܂<EFBFBD><DC82>B<BR>
<CODE><PRE>
c = BigDecimal("1.23456").round # ==> 1
c = BigDecimal("-1.23456").round # ==> -1
</PRE></CODE>
<EFBFBD>ȉ<EFBFBD><EFBFBD>̂悤<EFBFBD>Ɉ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>^<5E><><EFBFBD>āA<C481><41><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD>ȉ<EFBFBD> n+1 <20>ʂ̐<CA82><CC90><EFBFBD><EFBFBD>𑀍삷<F091808D><EFBFBD>Ƃ<EFBFBD><C682>ł<EFBFBD><C582>܂<EFBFBD><DC82>B<BR>
n <20><><EFBFBD><EFBFBD><EFBFBD>̎<EFBFBD><CC8E>́A<CD81><41><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD>ȉ<EFBFBD> n+1 <20>ʂ̐<CA82><CC90><EFBFBD><EFBFBD><EFBFBD><EFBFBD>l<EFBFBD>̌ܓ<CC8C><DC93><EFBFBD><EFBFBD>܂<EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD>ȉ<EFBFBD><C889><EFBFBD><EFBFBD>A<EFBFBD>ő<EFBFBD> n <20><><EFBFBD>ɂ<EFBFBD><C982>܂<EFBFBD>)<29>B<BR>
n <20><><EFBFBD><EFBFBD><EFBFBD>̂Ƃ<CC82><C682>͏<EFBFBD><CD8F><EFBFBD><EFBFBD>_<EFBFBD>ȏ<EFBFBD> n <20><><EFBFBD>ڂ<EFBFBD><DA82>𑀍삵<F091808D>܂<EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD>ʒu<CA92><75><EFBFBD><EFBFBD>ɏ<EFBFBD><C98F>Ȃ<EFBFBD><C882>Ƃ<EFBFBD> n <20>‚<EFBFBD> 0 <20><><EFBFBD><EFBFBD><EFBFBD>т܂<D182>)<29>B
<CODE><PRE>
c = BigDecimal::new("1.23456").round(4) # ==> 1.2346
c = BigDecimal::new("15.23456").round(-1) # ==> 20.0
</PRE></CODE>
<EFBFBD>Q<EFBFBD>Ԗڂ̈<EFBFBD><EFBFBD><EFBFBD><EFBFBD>i<EFBFBD>f<EFBFBD>t<EFBFBD>H<EFBFBD><EFBFBD><EFBFBD>g<EFBFBD><EFBFBD> 0<>j<EFBFBD>Ƀ[<5B><><EFBFBD>ȊO<C88A><4F><EFBFBD>w<EFBFBD><EFBFBD><E882B7><EFBFBD>ƁA<C681><41><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Banker's rounding <20>ɂȂ<C982><C882>܂<EFBFBD><DC82>B<BR>
Banker's rounding <20>Ƃ́A<CD81>l<EFBFBD>̌ܓ<CC8C><DC93><EFBFBD><EFBFBD><EFBFBD><E99094><EFBFBD><EFBFBD> p <20>Ƃ<EFBFBD><C682>āAp &lt; 5 <20>Ȃ<EFBFBD><C882>؂<EFBFBD><D882>̂<EFBFBD> p &gt; 5 <20>Ȃ<EFBFBD><C882>؂<EFBFBD><D882><EFBFBD>A
p <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǂT<C782>̂Ƃ<CC82><C682><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͐؂<CD90><D882><EFBFBD><E382B0><EFBFBD>̐<EFBFBD><CC90><EFBFBD><EFBFBD>{<7B>P<EFBFBD><50><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɂȂ<C982><C882>Ƃ<EFBFBD><C682><EFBFBD><EFBFBD><EFBFBD><EFBFBD>؂<EFBFBD><D882><EFBFBD>܂<EFBFBD><DC82>B
<CODE><PRE>
c = BigDecimal::new("1.23456").round(3,1) # ==> 1.234
c = BigDecimal::new("1.23356").round(3,1) # ==> 1.234
</PRE></CODE>
</BLOCKQUOTE>
<LI><B>truncate</B></LI><BLOCKQUOTE>
c = a.truncate<BR>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD>ȉ<EFBFBD><EFBFBD>̐<EFBFBD><EFBFBD><EFBFBD><EFBFBD>؂<EFBFBD><EFBFBD>̂ĂĐ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>iBigDecimal <20>l<EFBFBD>j<EFBFBD>ɂ<EFBFBD><C982>܂<EFBFBD><DC82>B<BR>
<EFBFBD>ȉ<EFBFBD><EFBFBD>̂悤<EFBFBD>Ɉ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>^<5E><><EFBFBD>āA<C481><41><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD>ȉ<EFBFBD> n+1 <20>ʂ̐<CA82><CC90><EFBFBD><EFBFBD>𑀍삷<F091808D><EFBFBD>Ƃ<EFBFBD><C682>ł<EFBFBD><C582>܂<EFBFBD><DC82>B<BR>
n <20><><EFBFBD><EFBFBD><EFBFBD>̎<EFBFBD><CC8E>́A<CD81><41><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD>ȉ<EFBFBD> n+1 <20>ʂ̐<CA82><CC90><EFBFBD><EFBFBD><EFBFBD><EFBFBD>؂<EFBFBD><D882>̂Ă܂<C482>(<28><><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD>ȉ<EFBFBD><C889><EFBFBD><EFBFBD>A<EFBFBD>ő<EFBFBD> n <20><><EFBFBD>ɂ<EFBFBD><C982>܂<EFBFBD>)<29>B
n <20><><EFBFBD><EFBFBD><EFBFBD>̂Ƃ<CC82><C682>͏<EFBFBD><CD8F><EFBFBD><EFBFBD>_<EFBFBD>ȏ<EFBFBD> n <20><><EFBFBD>ڂ<EFBFBD><DA82>𑀍삵<F091808D>܂<EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD>ʒu<CA92><75><EFBFBD><EFBFBD>ɏ<EFBFBD><C98F>Ȃ<EFBFBD><C882>Ƃ<EFBFBD> n <20>‚<EFBFBD> 0 <20><><EFBFBD><EFBFBD><EFBFBD>т܂<D182>)<29>B<BR>
<CODE><PRE>
c = BigDecimal::new("1.23456").truncate(4) # ==> 1.2345
c = BigDecimal::new("15.23456").truncate(-1) # ==> 10.0
</PRE></CODE>
</BLOCKQUOTE>
<LI><B>divmod</B></LI><BLOCKQUOTE>
<EFBFBD><EFBFBD><EFBFBD>Ə<EFBFBD><EFBFBD>]<5D>̔z<CC94><7A><EFBFBD><EFBFBD><EFBFBD>Ԃ<EFBFBD><D482>܂<EFBFBD><DC82>B<BR>
c,r = a.divmod(b) # a = c*b + r<BR>
divmod<EFBFBD><EFBFBD><EFBFBD>\<5C>b<EFBFBD>h<EFBFBD><68> a = c * b + r <20>ƂȂ<C682> a / b <20>̕<EFBFBD><CC95><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD>^<5E>̏<EFBFBD> c <20>Ə<EFBFBD><C68F>] r <20><>
<EFBFBD>v<EFBFBD>Z<EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> c <20>͐<EFBFBD><CD90><EFBFBD><EFBFBD>i<EFBFBD><69><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̂Ȃ<CC82><C882><EFBFBD><EFBFBD><EFBFBD><EFBFBD>j<EFBFBD>ɂȂ<C982><C882>܂<EFBFBD><DC82>B<BR>
c = (a/b).floor <BR>
r = a - c*b<BR>
<EFBFBD>Ōv<EFBFBD>Z<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B
</BLOCKQUOTE>
<LI><B>remainder</B></LI><BLOCKQUOTE>
r=a.remainder(b)<BR>
a/b <20>̏<EFBFBD><CC8F>] r <20><><EFBFBD>v<EFBFBD>Z<EFBFBD><5A><EFBFBD>܂<EFBFBD><DC82>B<BR>
c = (a/b).fix <BR>
r = a - c*b<BR>
<EFBFBD>Ōv<EFBFBD>Z<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B
</BLOCKQUOTE>
<LI><B>abs</B></LI><BLOCKQUOTE>
<EFBFBD><EFBFBD><EFBFBD>̐<EFBFBD><EFBFBD>Βl<BR>
c = a.abs<BR>
</BLOCKQUOTE>
<LI><B>to_i</B></LI><BLOCKQUOTE>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD>ȉ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>؂<EFBFBD><EFBFBD>̂ĂĐ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɕϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B<BR>
i = a.to_i<BR>
i <20>͒l<CD92>ɉ<EFBFBD><C989><EFBFBD><EFBFBD><EFBFBD> Fixnum <20><> Bignum <20>ɂȂ<C982><C882>܂<EFBFBD><DC82>B
a <20><> Infinity <20><> NaN <20>̂Ƃ<CC82><C682>Ai <20><> nil <20>ɂȂ<C982><C882>܂<EFBFBD><DC82>B
</BLOCKQUOTE>
<LI><B>to_f</B></LI><BLOCKQUOTE>
Float <20>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD>ɕϊ<C995><CF8A><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߍׂ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>l<EFBFBD><EFBFBD><EFBFBD>K<EFBFBD>v<EFBFBD>Ȃ<EFBFBD><EFBFBD><EFBFBD> split <20><><EFBFBD>\<5C>b<EFBFBD>h<EFBFBD>𗘗p<F0979897><70><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>B
</BLOCKQUOTE>
<LI><B>to_s[(n)]</B></LI><BLOCKQUOTE>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɕϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD>("0.xxxxxEn"<22>̌`<60>ɂȂ<C982><C882>܂<EFBFBD><DC82>j<EFBFBD>B<BR>
s = a.to_s<BR>
n <20><><EFBFBD>w<EFBFBD><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682>́A<CD81><41><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> n <20><><EFBFBD><EFBFBD><EFBFBD>ɋ󔒂ŋ<F3949282><C58B>؂<EFBFBD><D882>܂<EFBFBD><DC82>B<BR>
s = a.to_s(n)
</BLOCKQUOTE>
<LI><B>exponent</B></LI><BLOCKQUOTE>
<EFBFBD>w<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>𐮐<EFBFBD><EFBFBD>l<EFBFBD>ŕԂ<EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B
n = a.exponent <BR>
<EFBFBD><EFBFBD> a <20>̒l<CC92><6C> 0.xxxxxxx*10**n <20><><EFBFBD>Ӗ<EFBFBD><D396><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
</BLOCKQUOTE>
<LI><B>prec</B></LI><BLOCKQUOTE>
n,m = a.prec<BR>
a <20>̗L<CC97><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (n) <20>ƍő<C68D><C591>L<EFBFBD><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (m) <20>̔z<CC94><7A><EFBFBD><EFBFBD><EFBFBD>Ԃ<EFBFBD><D482>܂<EFBFBD><DC82>B
</BLOCKQUOTE>
<LI><B>sign</B></LI><BLOCKQUOTE>
<EFBFBD>l<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(sign &gt; 0)<29>A<EFBFBD><41>(sign &lt; 0)<29>A<EFBFBD><41><EFBFBD>̑<EFBFBD>(sigh==0)<29>ł<EFBFBD><C582><EFBFBD>̏<EFBFBD><CC8F><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԃ<EFBFBD><D482>܂<EFBFBD><DC82>B
n = a.sign <BR>
<EFBFBD>Ƃ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƃ<EFBFBD> n <20>̒l<CC92><6C> a <20><><EFBFBD>ȉ<EFBFBD><C889>̂Ƃ<CC82><C682><EFBFBD><EFBFBD>Ӗ<EFBFBD><D396><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B<BR>
() <20>̒<EFBFBD><CC92>̐<EFBFBD><CC90><EFBFBD><EFBFBD>́A<CD81><41><EFBFBD>ۂ̒l<CC92>ł<EFBFBD>(<A HREF="#STRUCT"><EFBFBD>u<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\<5C><><EFBFBD>v</A><EFBFBD><EFBFBD><EFBFBD>Q<EFBFBD><EFBFBD>)<29>B<BR>
n = BigDecimal::SIGN_NaN(0) : a <20><> NaN<BR>
n = BigDecimal::SIGN_POSITIVE_ZERO(1) : a <20><> +0<BR>
n = BigDecimal::SIGN_NEGATIVE_ZERO(-1) : a <20><> -0<BR>
n = BigDecimal::SIGN_POSITIVE_FINITE(2) : a <20>͐<EFBFBD><CD90>̒l<BR>
n = BigDecimal::SIGN_NEGATIVE_FINITE(-2) : a <20>͕<EFBFBD><CD95>̒l<BR>
n = BigDecimal::SIGN_POSITIVE_INFINITE(3) : a <20><>+Infinity<BR>
n = BigDecimal::SIGN_NEGATIVE_INFINITE(-3) : a <20><>-Infinity<BR>
</BLOCKQUOTE>
<LI><B>nan?</B></LI><BLOCKQUOTE>
a.nan? <20><> a <20><>NaN<61>̂Ƃ<CC82><C682>^<5E><><EFBFBD>Ԃ<EFBFBD><D482>܂<EFBFBD><DC82>B
</BLOCKQUOTE>
<LI><B>infinite?</B></LI><BLOCKQUOTE>
a.infinite? <20><> a <20><>+<2B><><EFBFBD>̂Ƃ<CC82> 1 <20>A-<2D><><EFBFBD>̂Ƃ<CC82><C682><EFBFBD> -1<>A<EFBFBD><41><EFBFBD><EFBFBD><EFBFBD>ȊO<C88A>̂Ƃ<CC82><C682><EFBFBD> nil <20><><EFBFBD>Ԃ<EFBFBD><D482>܂<EFBFBD><DC82>B
</BLOCKQUOTE>
<LI><B>finite?</B></LI><BLOCKQUOTE>
a.finite? <20><> a <20><><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82><EFBFBD> NaN <20>łȂ<C582><C882>Ƃ<EFBFBD><C682>^<5E><><EFBFBD>Ԃ<EFBFBD><D482>܂<EFBFBD><DC82>B
</BLOCKQUOTE>
<LI><B>zero?</B></LI><BLOCKQUOTE>
a <20><> 0 <20>Ȃ<EFBFBD> true <20>ɂȂ<C982><C882>܂<EFBFBD><DC82>B<BR>
c = a.zero?
</BLOCKQUOTE>
<LI><B>nonzero?</B></LI><BLOCKQUOTE>
a <20><> 0 <20>Ȃ<EFBFBD> nil<69>A0 <20>ȊO<C88A>Ȃ<EFBFBD> a <20><><EFBFBD>̂<EFBFBD><CC82>̂<EFBFBD><CC82>Ԃ<EFBFBD><D482>܂<EFBFBD><DC82>B<BR>
c = a.nonzero?
</BLOCKQUOTE>
<LI><B>split</B></LI><BLOCKQUOTE>
BigDecimal <20>l<EFBFBD><6C> 0.xxxxxxx*10**n <20>ƕ\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682>ɁA<C981><41><EFBFBD><EFBFBD><EFBFBD>iNaN<61>̂Ƃ<CC82><C682><EFBFBD>
0<EFBFBD>A<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȊO<EFBFBD><EFBFBD>+1<><31>-1<>ɂȂ<C982><C882>܂<EFBFBD><DC82>j<EFBFBD>A
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̕<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>i"xxxxxxx"<22>j<EFBFBD>ƁA<C681><EFBFBD>i10<31>j<EFBFBD>A<EFBFBD>X<EFBFBD>Ɏw<C98E><77> n <20><><EFBFBD>z<EFBFBD><7A><EFBFBD><EFBFBD>
<EFBFBD>Ԃ<EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B<BR>
a=BigDecimal::new("3.14159265")<BR>
f,x,y,z = a.split<BR>
<EFBFBD>Ƃ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƁAf=+1<>Ax="314159265"<22>Ay=10<31>Az=1<>ɂȂ<C982><C882>܂<EFBFBD><DC82>B<BR>
<EFBFBD>]<5D><><EFBFBD>āA<BR>
s = "0."+x<BR>
b = f*(s.to_f)*(y**z)<BR>
<EFBFBD><EFBFBD> Float <20>ɕϊ<C995><CF8A><EFBFBD><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682>ł<EFBFBD><C582>܂<EFBFBD><DC82>B
</BLOCKQUOTE>
<LI><B>inspect</B></LI><BLOCKQUOTE>
<EFBFBD>f<EFBFBD>o<EFBFBD>b<EFBFBD>O<EFBFBD>o<EFBFBD>͂Ɏg<EFBFBD>p<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B<BR>
p a=BigDecimal::new("3.14",10)<BR>
<EFBFBD>Ƃ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƁA[0x112344:'0.314E1',4(12)]<5D>̂悤<CC82>ɏo<C98F>͂<EFBFBD><CD82><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
<EFBFBD>ŏ<EFBFBD><EFBFBD><EFBFBD>16<EFBFBD>i<EFBFBD><EFBFBD><EFBFBD>̓I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD>̃A<EFBFBD>h<EFBFBD><EFBFBD><EFBFBD>X<EFBFBD>A<EFBFBD><EFBFBD><EFBFBD><EFBFBD> '0.314E1' <20>͒l<CD92>A
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>4<EFBFBD>͌<EFBFBD><EFBFBD>݂̗L<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28>\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E582AB><EFBFBD><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD>)<29>A
<EFBFBD>Ō<EFBFBD><EFBFBD>̓I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ő包<EFBFBD><EFBFBD><EFBFBD>ɂȂ<EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B
</BLOCKQUOTE>
<LI><B>**</B></LI><BLOCKQUOTE>
a <20><> n <20><><EFBFBD><EFBFBD><EFBFBD>v<EFBFBD>Z<EFBFBD><5A><EFBFBD>܂<EFBFBD><DC82>B<EFBFBD><42><EFBFBD>͐<EFBFBD><CD90><EFBFBD><EFBFBD>B<BR>
c = a ** n<BR>
<EFBFBD><EFBFBD><EFBFBD>ʂƂ<EFBFBD><EFBFBD><EFBFBD> c <20>̗L<CC97><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD> a <20><> n <20>{<7B>ȏ<EFBFBD><C88F>ɂȂ<C982><C882>̂Œ<CC82><C592>ӁB
</BLOCKQUOTE>
<LI><B>power</B></LI><BLOCKQUOTE>
** <20>Ɠ<EFBFBD><C693><EFBFBD><EFBFBD>ŁAa <20><> n <20><><EFBFBD><EFBFBD><EFBFBD>v<EFBFBD>Z<EFBFBD><5A><EFBFBD>܂<EFBFBD><DC82>B<EFBFBD><42><EFBFBD>͐<EFBFBD><CD90><EFBFBD><EFBFBD>B<BR>
c = a.power(n)<BR>
<EFBFBD><EFBFBD><EFBFBD>ʂƂ<EFBFBD><EFBFBD><EFBFBD> c <20>̗L<CC97><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD> a <20><> n <20>{<7B>ȏ<EFBFBD><C88F>ɂȂ<C982><C882>̂Œ<CC82><C592>ӁB
</BLOCKQUOTE>
<LI><B>sqrt</B></LI><BLOCKQUOTE>
a<EFBFBD>̗L<EFBFBD><EFBFBD><EFBFBD><EFBFBD> n <20><><EFBFBD>̕<EFBFBD><CC95><EFBFBD><EFBFBD><EFBFBD><EFBFBD>in <20>̕<EFBFBD><CC95><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ł͂<C582><CD82><EFBFBD><EFBFBD>܂<EFBFBD><DC82><EFBFBD><EFBFBD>j<EFBFBD><6A>
<EFBFBD>j<EFBFBD><EFBFBD><EFBFBD>[<5B>g<EFBFBD><67><EFBFBD>@<40>Ōv<C58C>Z<EFBFBD><5A><EFBFBD>܂<EFBFBD><DC82>B<BR>
c = a.sqrt(n)<BR>
</BLOCKQUOTE>
<LI><B>&lt=&gt</B></LI><BLOCKQUOTE>
a==b <20>Ȃ<EFBFBD> 0<>Aa &gt b <20>Ȃ<EFBFBD> 1<>Aa &lt b <20>Ȃ<EFBFBD> -1 <20>ɂȂ<C982><C882>܂<EFBFBD><DC82>B<BR>
c = a &lt=&gt b
</BLOCKQUOTE>
</UL>
<EFBFBD><EFBFBD><EFBFBD>́A<EFBFBD>ǂ<EFBFBD><EFBFBD>Ŏ<EFBFBD><EFBFBD>̔@<40><><EFBFBD>ł<EFBFBD><C582>B<BR>
<UL>
<LI><B>==</B></LI>
<LI><B>===</B></LI>
<EFBFBD>u==<3D>v<EFBFBD>Ɠ<EFBFBD><C693><EFBFBD><EFBFBD>ł<EFBFBD><C582><EFBFBD> case <20><><EFBFBD>Ŏg<C58E>p<EFBFBD><70><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
<LI><B>!=</B></LI>
<LI><B>&lt</B></LI>
<LI><B>&lt=</B></LI>
<LI><B>&gt</B></LI>
<LI><B>&gt=</B></LI>
</UL>
<H4><U>(<28>]<5D><><EFBFBD>i<EFBFBD>K<EFBFBD><4B>)<29>N<EFBFBD><4E><EFBFBD>X<EFBFBD><58><EFBFBD>\<5C>b<EFBFBD>h</U></H4>
<EFBFBD>ȉ<EFBFBD><EFBFBD>̃N<EFBFBD><EFBFBD><EFBFBD>X<EFBFBD><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I><B>PI</B></LI><BLOCKQUOTE>
<EFBFBD>~<7E><><EFBFBD><EFBFBD>(=3.14159265358979....)<29><><EFBFBD>v<EFBFBD>Z<EFBFBD><5A><EFBFBD>܂<EFBFBD><DC82>iJ<69>DMachin<69>̌<EFBFBD><CC8C><EFBFBD><EFBFBD><EFBFBD><EFBFBD>p<EFBFBD><70><EFBFBD>܂<EFBFBD><DC82>j<EFBFBD>B<BR>
e = BigDecimal::PI(n)<BR>
n <20>͕K<CD95>v<EFBFBD>ȗL<C897><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>𐮐<EFBFBD><F090AE90>Ŏw<C58E><EFBFBD>܂<EFBFBD><DC82>B
</BLOCKQUOTE>
</UL>
<H4><U>(<28>]<5D><><EFBFBD>i<EFBFBD>K<EFBFBD><4B>)<29>C<EFBFBD><43><EFBFBD>X<EFBFBD>^<5E><><EFBFBD>X<EFBFBD><58><EFBFBD>\<5C>b<EFBFBD>h</U></H4>
<EFBFBD>ȉ<EFBFBD><EFBFBD>̃C<EFBFBD><EFBFBD><EFBFBD>X<EFBFBD>^<5E><><EFBFBD>X<EFBFBD><58><EFBFBD>\<5C>b<EFBFBD>h<EFBFBD>́A<CD81>܂<EFBFBD><DC82>]<5D><><EFBFBD>i<EFBFBD>K<EFBFBD>ł<EFBFBD><C582>̂ŁA<C581>ʏ<EFBFBD><CA8F>ł<EFBFBD>
<EFBFBD>g<EFBFBD>p<EFBFBD>ł<EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD><EFBFBD><EFBFBD>B<EFBFBD>g<EFBFBD>p<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɂ<EFBFBD> bigdecimal.c <20><>
<EFBFBD>u/* #define ENABLE_TRIAL_METHOD */<2F>v
<EFBFBD>̃R<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>g<EFBFBD><EFBFBD><EFBFBD>O<EFBFBD><EFBFBD><EFBFBD>āA<EFBFBD>ăR<EFBFBD><EFBFBD><EFBFBD>p<EFBFBD>C<EFBFBD><EFBFBD><EFBFBD>E<EFBFBD>ăC<EFBFBD><EFBFBD><EFBFBD>X<EFBFBD>g<EFBFBD>[<5B><><EFBFBD><EFBFBD><EFBFBD>K<EFBFBD>v<EFBFBD>ł<EFBFBD><C582>B
<UL>
<LI><B>sincos</B></LI><BLOCKQUOTE>
a <20>̗L<CC97><4C><EFBFBD><EFBFBD> n <20><><EFBFBD><EFBFBD> sin <20><> cos <20>𓯎<EFBFBD><F093AF8E>Ɂi<C981>e<EFBFBD>C<EFBFBD><43><EFBFBD>[<5B>W<EFBFBD>J<EFBFBD>Łj<C581>v<EFBFBD>Z<EFBFBD><5A><EFBFBD>āA
sin <20><> cos <20>̔z<CC94><7A><EFBFBD><EFBFBD><EFBFBD>Ԃ<EFBFBD><D482>܂<EFBFBD><DC82>B
n <20>͕K<CD95>v<EFBFBD>ȗL<C897><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ł<EFBFBD><C582>i n <20><> sin <20><> cos <20><><EFBFBD>v<EFBFBD>Z<EFBFBD><5A><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ł͂<C582><CD82><EFBFBD><EFBFBD>܂<EFBFBD><DC82><EFBFBD><EFBFBD>j<EFBFBD>B
<BR>
sin,cos = a.sincos(n)<BR>
|a| &lt; 2*3.1415....<2E>łȂ<C582><C882>Ɛ<EFBFBD><C690><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>v<EFBFBD>Z<EFBFBD>ł<EFBFBD><C582>Ȃ<EFBFBD><C882><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
</BLOCKQUOTE>
<LI><B>exp</B></LI><BLOCKQUOTE>
<EFBFBD><EFBFBD><EFBFBD>R<EFBFBD>ΐ<EFBFBD><EFBFBD>̒<EFBFBD>e(=2.718281828....)<29><> a <20><><EFBFBD><EFBFBD><EFBFBD>v<EFBFBD>Z<EFBFBD><5A><EFBFBD>܂<EFBFBD><DC82>B<BR>
c = a.exp(n)<BR>
n <20>͕K<CD95>v<EFBFBD>ȗL<C897><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ł<EFBFBD><C582>B
</BLOCKQUOTE>
</UL>
<H3>coerce<EFBFBD>ɂ‚<EFBFBD><EFBFBD><EFBFBD></H3>
BigDecimal <20>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD><67><EFBFBD>Z<EFBFBD>p<EFBFBD><70><EFBFBD>Z<EFBFBD>q<EFBFBD>̍<EFBFBD><CC8D>ɂ<EFBFBD><C982><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682>́ABigDecimal <20>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD><67>
<EFBFBD>E<EFBFBD>ɂ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD><EFBFBD>(<28>K<EFBFBD>v<EFBFBD>Ȃ<EFBFBD>) BigDecimal <20>ɕϊ<C995><CF8A><EFBFBD><EFBFBD>Ă<EFBFBD><C482><EFBFBD><EFBFBD>v<EFBFBD>Z<EFBFBD><5A><EFBFBD>܂<EFBFBD><DC82>B
<EFBFBD>]<5D><><EFBFBD>āABigDecimal <20>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD>ȊO<C88A>ł<EFBFBD><C582><EFBFBD><EFBFBD>l<EFBFBD><6C><EFBFBD>Ӗ<EFBFBD><D396><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̂Ȃ<CC82><C882>E<EFBFBD>ɒu<C992><75><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD>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BD>^<5E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͒<EFBFBD><CD92>ӂ<EFBFBD><D382>K<EFBFBD>v<EFBFBD>ł<EFBFBD><C582>B<EFBFBD><42><EFBFBD>l<EFBFBD>ɕϊ<C995><CF8A>ł<EFBFBD><C582>Ȃ<EFBFBD><C882><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƁA
<EFBFBD>P<EFBFBD>ɕϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>~<7E>߂邾<DF82><E982BE><EFBFBD>ŃG<C583><47><EFBFBD>[<5B>ɂ͂Ȃ<CD82><C882>܂<EFBFBD><DC82><EFBFBD><EFBFBD>B"10XX"<22>Ȃ<EFBFBD><C882>P<EFBFBD>O<EFBFBD>A"XXXX"<22>͂O
<EFBFBD>ƈ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B<BR>
<CODE><PRE>
a = BigDecimal.E(20)
c = a * "0.123456789123456789123456789" # <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> BigDecimal <20>ɕϊ<C995><CF8A><EFBFBD><EFBFBD>Ă<EFBFBD><C482><EFBFBD><EFBFBD>v<EFBFBD>Z
</PRE></CODE>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>񐔂<EFBFBD><EFBFBD>\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682>āA"Infinity"<22>A"+Infinity"<22>A"-Infinity"<22>A"NaN"
<EFBFBD><EFBFBD><EFBFBD>g<EFBFBD>p<EFBFBD>ł<EFBFBD><EFBFBD>܂<EFBFBD>(<28><EFBFBD><E595B6><EFBFBD>E<EFBFBD><45><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʂ<EFBFBD><CA82>܂<EFBFBD>)<29>B<EFBFBD><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Amode <20><><EFBFBD>\<5C>b<EFBFBD>h<EFBFBD><68> false <20><>
<EFBFBD>w<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͗<EFBFBD><EFBFBD>O<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B
<BR>
<EFBFBD>܂<EFBFBD><EFBFBD>ABigDecimal<EFBFBD>N<EFBFBD><EFBFBD><EFBFBD>X<EFBFBD><EFBFBD> coerce<63>iRuby<62>{<7B>Q<EFBFBD>Ɓj<C681><6A><EFBFBD>T<EFBFBD>|<7C>[<5B>g<EFBFBD><67><EFBFBD>Ă<EFBFBD><C482>܂<EFBFBD><DC82>B
<EFBFBD>]<5D><><EFBFBD>āABigDecimal <20>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD><67><EFBFBD>E<EFBFBD>ɂ<EFBFBD><C982><EFBFBD><EFBFBD><EFBFBD><EA8D87><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͑<EFBFBD><CD91><EFBFBD><EFBFBD>v<EFBFBD>ł<EFBFBD><C582>B
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD><EFBFBD><EFBFBD>݂<EFBFBD> Ruby <20>C<EFBFBD><43><EFBFBD>^<5E>v<EFBFBD><76><EFBFBD>^<5E>̎d<CC8E>l<EFBFBD><6C><EFBFBD>A<EFBFBD><41><EFBFBD><EFBFBD><EFBFBD>񂪍<EFBFBD><F182AA8D>ɂ<EFBFBD><C982><EFBFBD><EFBFBD>ƌv<C68C>Z<EFBFBD>ł<EFBFBD><C582>܂<EFBFBD><DC82><EFBFBD><EFBFBD>B<BR>
<CODE><PRE>
a = BigDecimal.E(20)
c = "0.123456789123456789123456789" * a # <20>G<EFBFBD><47><EFBFBD>[
</PRE></CODE>
<EFBFBD>K<EFBFBD>v<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƃ͎v<EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>񂪁A<EFBFBD>ǂ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ă<EFBFBD><EFBFBD>ƌ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>l<EFBFBD><EFBFBD>
String <20>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD><67><EFBFBD>p<EFBFBD><70><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>V<EFBFBD><56><EFBFBD>ȃN<C883><4E><EFBFBD>X<EFBFBD><58><EFBFBD><EFBFBD><EC90AC><EFBFBD>Ă<EFBFBD><C482><EFBFBD><EFBFBD>A
<EFBFBD><EFBFBD><EFBFBD>̃N<EFBFBD><EFBFBD><EFBFBD>X<EFBFBD><EFBFBD> coerce <20><><EFBFBD>T<EFBFBD>|<7C>[<5B>g<EFBFBD><67><EFBFBD>Ă<EFBFBD><C482><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>B
<hr>
<A NAME="#UNDEF">
<H2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD>񐔁A<EFBFBD>[<5B><><EFBFBD>̈<EFBFBD><CC88><EFBFBD></H2>
<EFBFBD>u<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>v<EFBFBD>Ƃ͕\<5C><><EFBFBD>ł<EFBFBD><C582>Ȃ<EFBFBD><C882><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȑ<EFBFBD><C890>ł<EFBFBD><C582>B<EFBFBD><42><EFBFBD>ʂɈ<CA82><C988><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߂<EFBFBD>
+Infinity<74>i<EFBFBD><69><EFBFBD>̖<EFBFBD><CC96><EFBFBD><EFBFBD><EFBFBD><EFBFBD>j<EFBFBD><6A> -Infinity<74>i<EFBFBD><69><EFBFBD>̖<EFBFBD><CC96><EFBFBD><EFBFBD><EFBFBD><EFBFBD>j<EFBFBD>Ƃ<EFBFBD><C682><EFBFBD>
<EFBFBD><EFBFBD>ɕ\<5C>L<EFBFBD><4C><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1.0/0.0 <20>̂悤<CC82>Ƀ[<5B><><EFBFBD>Ŋ<EFBFBD><C58A><EFBFBD><EFBFBD><EFBFBD>Ȍv<C88C>Z<EFBFBD><5A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682>ɐ<EFBFBD><C990><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
<BR><BR>
<EFBFBD>u<EFBFBD>񐔁v<EFBFBD><EFBFBD> 0.0/0.0 <20><> Infinity-Infinity <20><><EFBFBD>̌<EFBFBD><CC8C>ʂ<EFBFBD><CA82><EFBFBD><EFBFBD>`<60>ł<EFBFBD><C582>Ȃ<EFBFBD>
<EFBFBD>v<EFBFBD>Z<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƃ<EFBFBD><EFBFBD>ɐ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B<EFBFBD>񐔂<EFBFBD> NaN<61>iNot a Number<65>j<EFBFBD>ƕ\<5C>L<EFBFBD><4C><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
NaN <20><><EFBFBD>܂ތv<DE8C>Z<EFBFBD>͑S<CD91><53> NaN <20>ɂȂ<C982><C882>܂<EFBFBD><DC82>B<EFBFBD>܂<EFBFBD> NaN <20>͎<EFBFBD><CD8E><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂߂āA<C481>ǂ<EFBFBD><C782>Ȑ<EFBFBD>
<EFBFBD>Ƃ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>v<EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD><EFBFBD><EFBFBD>B
<BR><BR>
<EFBFBD>[<5B><><EFBFBD><EFBFBD> +0.0 <20><> -0.0 <20><><EFBFBD><EFBFBD><EFBFBD>݂<EFBFBD><DD82>܂<EFBFBD><DC82>B<EFBFBD><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A+0.0==-0.0 <20><> true <20>ł<EFBFBD><C582>B
<BR><BR>
Infinity<EFBFBD>ANaN<EFBFBD>A +0.0 <20><> -0.0 <20><><EFBFBD><EFBFBD><EFBFBD>܂񂾌v<F182BE8C>Z<EFBFBD><5A><EFBFBD>ʂ͑g<CD91>ݍ<EFBFBD><DD8D><EFBFBD><ED82B9>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>G<EFBFBD>ł<EFBFBD><EFBFBD>B<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̂<EFBFBD><EFBFBD><EFBFBD><EFBFBD>l<EFBFBD>́A<EFBFBD>ȉ<EFBFBD><EFBFBD>̃v<EFBFBD><EFBFBD><EFBFBD>O<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>s<EFBFBD><EFBFBD><EFBFBD>Č<EFBFBD><EFBFBD>ʂ<EFBFBD>
<EFBFBD>m<EFBFBD>F<EFBFBD><EFBFBD><EFBFBD>Ă<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>i<EFBFBD><EFBFBD><EFBFBD>ʂɂ‚<EFBFBD><EFBFBD>āA<EFBFBD>^<5E><><EFBFBD><EFBFBD><EFBFBD>ԈႢ<D488>𔭌<EFBFBD><F094AD8C><EFBFBD><EFBFBD><EFBFBD><EA82BD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD>m<EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>j<EFBFBD>B
<PRE>
<CODE>
require "bigdecimal"
aa = %w(1 -1 +0.0 -0.0 +Infinity -Infinity NaN)
ba = %w(1 -1 +0.0 -0.0 +Infinity -Infinity NaN)
opa = %w(+ - * / <=> > >= < == != <=)
for a in aa
for b in ba
for op in opa
x = BigDecimal::new(a)
y = BigDecimal::new(b)
eval("ans= x #{op} y;print a,' ',op,' ',b,' ==> ',ans.to_s,\"\n\"")
end
end
end
</CODE>
</PRE>
<hr>
<A NAME="#STRUCT">
<H2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\<5C><></H2>
BigDecimal<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŕ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD>͍\<5C><><EFBFBD><EFBFBD>(Real)<29>ŕ\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
<EFBFBD><EFBFBD><EFBFBD>̂<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> unsigned long <20>̔z<CC94><7A>(<28>ȉ<EFBFBD><C889>̍\<5C><><EFBFBD>̗v<CC97>ffrac)<29>ŊǗ<C58A><C797><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
<EFBFBD>T<EFBFBD>O<EFBFBD>I<EFBFBD>ɂ́A<EFBFBD>ȉ<EFBFBD><EFBFBD>̂悤<EFBFBD>ɂȂ<EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B<BR><BR>
<<EFBFBD><EFBFBD><E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BFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>΂<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ł<EFBFBD><EFBFBD>j<EFBFBD>B
BASE<EFBFBD><EFBFBD>10000<EFBFBD>̂Ƃ<EFBFBD><EFBFBD>́A<EFBFBD>ȉ<EFBFBD><EFBFBD>̉<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̔z<EFBFBD><EFBFBD>(frac)<29>̊e<CC8A>v<EFBFBD>f<EFBFBD>ɂ͍ő<CD8D><C591>łS<C582><53><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>i<EFBFBD>[<5B><><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B<BR><BR>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD>\<5C><><EFBFBD><EFBFBD>(Real)<29>͈ȉ<CD88><C889>̂悤<CC82>ɂȂ<C982><C882>Ă<EFBFBD><C482>܂<EFBFBD><DC82>B
<BR>
<CODE><PRE>
typedef struct {
unsigned long MaxPrec; // <20>ő吸<C591>x(frac[]<5D>̔z<CC94><7A><EFBFBD>T<EFBFBD>C<EFBFBD>Y)
unsigned long Prec; // <20><><EFBFBD>x(frac[]<5D>̎g<CC8E>p<EFBFBD>T<EFBFBD>C<EFBFBD>Y)
short sign; // <20>ȉ<EFBFBD><C889>̂悤<CC82>ɕ<EFBFBD><C995><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̏<EFBFBD><CC8F>Ԃ<EFBFBD><D482><EFBFBD><EFBFBD>`<60><><EFBFBD>܂<EFBFBD><DC82>B
// ==0 : NaN
// 1 : +0
// -1 : -0
// 2 : <20><><EFBFBD>̒l
// -2 : <20><><EFBFBD>̒l
// 3 : +Infinity
// -3 : -Infinity
unsigned short flag; // <20>e<EFBFBD><65><EFBFBD>̐<EFBFBD><CC90><EFBFBD><EFBFBD>t<EFBFBD><74><EFBFBD>b<EFBFBD>O
int exponent; // <20>w<EFBFBD><77><EFBFBD><EFBFBD><EFBFBD>̒l(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*BASE**exponent)
unsigned long frac[1]; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̔z<CC94><7A>(<28>•<EFBFBD>)
} Real;
</CODE></PRE>
<EFBFBD><EFBFBD><EFBFBD> 1234.56784321 <20>Ƃ<EFBFBD><C682><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(BASE=10000<30>Ȃ<EFBFBD>)<BR>
<PRE>
0.1234 5678 4321*(10000)**1
</PRE>
<EFBFBD>ł<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> frac[0]=1234<33>Afrac[1]=5678<37>Afrac[2]=4321<32>A
Prec=3<>Asign=2<>Aexponent=1 <20>ƂȂ<C682><C882>܂<EFBFBD><DC82>BMaxPrec<65><63>
Prec <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E582AB><EFBFBD><EFBFBD><EFBFBD>΂<EFBFBD><CE82><EFBFBD><EFBFBD>‚ł<C282><C582><EFBFBD><EFBFBD>܂<EFBFBD><DC82>܂<EFBFBD><DC82><EFBFBD><EFBFBD>Bflag <20><>
<EFBFBD>g<EFBFBD>p<EFBFBD><EFBFBD><EFBFBD>@<40>͎<EFBFBD><CD8E><EFBFBD><EFBFBD>Ɉˑ<C988><CB91><EFBFBD><EFBFBD>ē<EFBFBD><C493><EFBFBD><EFBFBD>Ŏg<C58E>p<EFBFBD><70><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
<hr>
<A NAME="#BASE">
<H2>2<EFBFBD>i<EFBFBD><EFBFBD>10<EFBFBD>i</H2>
BigDecimal <20><> <<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD><EFBFBD>> = 0.xxxxxxxxx*10**n <20>Ƃ<EFBFBD><C682><EFBFBD>10<31>i<EFBFBD>`<60><><EFBFBD>Ő<EFBFBD><C590>l<EFBFBD><6C><EFBFBD>ێ<EFBFBD><DB8E><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD>v<EFBFBD>Z<EFBFBD>@<40>̕<EFBFBD><CC95><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD><5F><EFBFBD>̓<EFBFBD><CC93><EFBFBD><EFBFBD>\<5C><><EFBFBD>́A<CD81><41><EFBFBD><EFBFBD><EFBFBD>܂ł<DC82><C582>Ȃ<EFBFBD> <<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD><EFBFBD>> = 0.bbbbbbbb*2**n <20>Ƃ<EFBFBD><C682><EFBFBD>
2<EFBFBD>i<EFBFBD>`<60><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʂł<CA82>(x <20><> 0 <20><><EFBFBD><EFBFBD> 9 <20>܂ŁAb <20><> 0 <20><> 1 <20>̐<EFBFBD><CC90><EFBFBD>)<29>B
BigDecimal <20><><EFBFBD>Ȃ<EFBFBD>10<31>i<EFBFBD>̓<EFBFBD><CC93><EFBFBD><EFBFBD>\<5C><><EFBFBD>`<60><><EFBFBD><EFBFBD><EFBFBD>̗p<CC97><70><EFBFBD><EFBFBD><EFBFBD>̂<EFBFBD><CC82><EFBFBD><EFBFBD>ȉ<EFBFBD><C889>ɐ<EFBFBD><C990><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
<H4>10<EFBFBD>i<EFBFBD>̃<EFBFBD><EFBFBD><EFBFBD><EFBFBD>b<EFBFBD>g</H4>
<DL>
<DT><EFBFBD>f<EFBFBD>o<EFBFBD>b<EFBFBD>O<EFBFBD>̂<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<DD><EFBFBD>܂<EFBFBD><EFBFBD>A<EFBFBD>v<EFBFBD><EFBFBD><EFBFBD>O<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>y<EFBFBD>ł<EFBFBD><EFBFBD>Bfrac[0]=1234<33>Afrac[1]=5678<37>Afrac[2]=4321<32>A
exponent=1<>Asign=2 <20>Ȃ琔<C882>l<EFBFBD><6C> 1234.56784321 <20>ł<EFBFBD><C582><EFBFBD><EFBFBD>̂͌<CC82><CD8C><EFBFBD><EFBFBD>Β<EFBFBD><CE92><EFBFBD><EFBFBD>ɕ<EFBFBD><C995><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
<DT>10<EFBFBD>i<EFBFBD>\<5C>L<EFBFBD><4C><EFBFBD><EFBFBD><EA82BD><EFBFBD>l<EFBFBD>Ȃ<EFBFBD><C882>m<EFBFBD><6D><EFBFBD>ɓ<EFBFBD><C993><EFBFBD><EFBFBD>\<5C><><EFBFBD>ɕϊ<C995><CF8A>ł<EFBFBD><C582><EFBFBD>
<DD><EFBFBD><EFBFBD>΁A<EFBFBD>ȉ<EFBFBD><EFBFBD>̂悤<EFBFBD>ȃv<EFBFBD><EFBFBD><EFBFBD>O<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͑S<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD>v<EFBFBD>Z<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƃ<EFBFBD><EFBFBD>ł<EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B<EFBFBD>ȉ<EFBFBD><EFBFBD>̗<EFBFBD><EFBFBD>́A<EFBFBD><EFBFBD><EFBFBD>s<EFBFBD>Ɉ<EFBFBD><EFBFBD>‚̐<EFBFBD><EFBFBD>l
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ă<EFBFBD><EFBFBD><EFBFBD><EFBFBD>t<EFBFBD>@<40>C<EFBFBD><43> file <20>̍<EFBFBD><CC8D>v<EFBFBD><76><EFBFBD>l<EFBFBD><6C><EFBFBD><EFBFBD><EFBFBD>߂<EFBFBD><DF82><EFBFBD><EFBFBD>̂ł<CC82><C582>B
<CODE><PRE>
file = File::open(....,"r")
s = BigDecimal::new("0")
while line = file.gets
s = s + line
end
</PRE></CODE>
<EFBFBD><EFBFBD><EFBFBD>̗<EFBFBD><EFBFBD><EFBFBD>2<EFBFBD>i<EFBFBD><EFBFBD><EFBFBD>ł<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƌ덷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>މ”\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
<EFBFBD><EFBFBD><EFBFBD> 0.1 <20><>2<EFBFBD>i<EFBFBD>ŕ\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0.1 = b1*2**(-1)+b1*2**(-2)+b3*2**(-3)+b4*2**(-4)....
<EFBFBD>Ɩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɑ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ă<EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>܂<EFBFBD>(b1=0,b2=0,b3=0,b4=1...)<29>B<EFBFBD><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD> bn(n=1,2,3,...) <20><>
2<EFBFBD>i<EFBFBD><EFBFBD><EFBFBD>\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0 <20><> 1 <20>̐<EFBFBD><CC90><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ł<EFBFBD><C582>B<EFBFBD>]<5D><><EFBFBD>āA<C481>ǂ<EFBFBD><C782><EFBFBD><EFBFBD>őł<C591><C582>؂<EFBFBD><D882>K<EFBFBD>v<EFBFBD><76><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŕϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ēx10<EFBFBD>i<EFBFBD>\<5C>L<EFBFBD>ɂ<EFBFBD><C982>Ĉ<EFBFBD><C488><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E682A4>
<EFBFBD><EFBFBD>͓K<EFBFBD>؂Ȋۂߑ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>i<EFBFBD>l<EFBFBD>̌ܓ<EFBFBD><EFBFBD>j<EFBFBD>ɂ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>čĂ<EFBFBD> "0.1" <20>ƕ\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B<EFBFBD><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ł͐<EFBFBD><EFBFBD>m<EFBFBD><EFBFBD> 0.1 <20>ł͂<C582><CD82><EFBFBD><EFBFBD>܂<EFBFBD><DC82><EFBFBD><EFBFBD>B
<DT><EFBFBD>L<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͗L<EFBFBD><EFBFBD><E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BFBD><EFBFBD>B<BR><BR>
<EFBFBD>P<EFBFBD>D<EFBFBD><EFBFBD><EFBFBD>Z<EFBFBD><EFBFBD>(a <20>̗L<CC97><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)+(b <20>̗L<CC97><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<29>A
<EFBFBD><EFBFBD><EFBFBD>Z<EFBFBD><EFBFBD>(a <20>̍ő<CC8D><C591>L<EFBFBD><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)+(b <20>̍ő<CC8D><C591>L<EFBFBD><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<29><><EFBFBD>̍ő包<C591><E58C85><EFBFBD>i<EFBFBD><69><EFBFBD>ۂ́A<CD81>]<5D>T<EFBFBD><54><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>āA
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȃ<EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>j<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>•ϐ<EFBFBD> c <20><><EFBFBD>V<EFBFBD><56><EFBFBD>ɐ<EFBFBD><C990><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Z<EFBFBD>̏ꍇ<EFBFBD>́A<EFBFBD><EFBFBD><EFBFBD><EFBFBD>o<EFBFBD>Ȃ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̐<EFBFBD><EFBFBD>x<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> c <20>𐶐<EFBFBD><F090B690><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B<EFBFBD><EFBFBD><E182A6>
c = 0.1+0.1*10**(-100) <20>̂悤<CC82>ȏꍇ<C88F>Ac <20>̐<EFBFBD><CC90>x<EFBFBD>͂P<CD82>O<EFBFBD>O<EFBFBD><4F><EFBFBD>ȏ<EFBFBD><C88F>̐<EFBFBD><CC90>x<EFBFBD><78>
<EFBFBD><EFBFBD><EFBFBD>‚<EFBFBD>ɂȂ<EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B
<BR><BR>
<EFBFBD>Q<EFBFBD>D<EFBFBD><EFBFBD><EFBFBD><EFBFBD> c = a op b <20>̌v<CC8C>Z<EFBFBD><5A><EFBFBD><EFBFBD><EFBFBD>s<EFBFBD><73><EFBFBD>܂<EFBFBD><DC82>B<BR><BR>
<EFBFBD><EFBFBD><EFBFBD>̂悤<EFBFBD>ɁA<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Z<EFBFBD>Ə<EFBFBD><EFBFBD>Z<EFBFBD>ł<EFBFBD> c <20>͕K<CD95><4B><EFBFBD>u<EFBFBD><EFBFBD><EB8DB7><EFBFBD>o<EFBFBD>Ȃ<EFBFBD><C882>v<EFBFBD><76><EFBFBD><EFBFBD><EFBFBD>̐<EFBFBD><CC90>x<EFBFBD><78>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Đ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD>(BigDecimal.limit <20><><EFBFBD>w<EFBFBD><EFBFBD>Ȃ<EFBFBD><C882>ꍇ)<29>B
<EFBFBD><EFBFBD><EFBFBD>Z<EFBFBD><EFBFBD>(a <20>̍ő<CC8D><C591>L<EFBFBD><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)+(b <20>̍ő<CC8D><C591>L<EFBFBD><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<29><><EFBFBD>̍ő包<C591><E58C85>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> c <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82><EFBFBD><EFBFBD>Ac = 1.0/3.0 <20>̂悤<CC82>Ȍv<C88C>Z<EFBFBD>Ŗ<EFBFBD><C596><EFBFBD>Ȃ悤<C882>ɁA
c <20>̍ő吸<C591>x<EFBFBD>𒴂<EFBFBD><F092B482><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682><EFBFBD><EFBFBD>Ōv<C58C>Z<EFBFBD><5A><EFBFBD>ł<EFBFBD><C582>؂<EFBFBD><D882><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EA8D87><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B<BR><BR>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɂ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ac <20>̍ő吸<C591>x<EFBFBD><78> a <20><> b <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E582AB><EFBFBD>Ȃ<EFBFBD><C882>܂<EFBFBD><DC82>̂<EFBFBD> c <20><><EFBFBD>K<EFBFBD>v<EFBFBD>Ƃ<EFBFBD><C682><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>[<5B>̈<EFBFBD><CC88>͑傫<CD91><E582AB><EFBFBD>Ȃ邱<C882>Ƃɒ<C682><C992>ӂ<EFBFBD><D382>ĉ<EFBFBD><C489><EFBFBD><EFBFBD><EFBFBD><EFBFBD>B
<BR><BR>
<EFBFBD><EFBFBD><EFBFBD>ӁF<EFBFBD>u+,-,*,/<2F>v<EFBFBD>ł͌<C582><CD8C>ʂ̐<CA82><CC90>x<EFBFBD>i<EFBFBD>L<EFBFBD><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>j<EFBFBD><6A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŏw<C58E><77><EFBFBD>ł<EFBFBD><C582>܂<EFBFBD><DC82><EFBFBD><EFBFBD>B
<EFBFBD><EFBFBD><EFBFBD>x<EFBFBD><EFBFBD><EFBFBD>R<EFBFBD><EFBFBD><EFBFBD>g<EFBFBD><EFBFBD><EFBFBD>[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>́A<CD81>ȉ<EFBFBD><C889>̃C<CC83><43><EFBFBD>X<EFBFBD>^<5E><><EFBFBD>X<EFBFBD><58><EFBFBD>\<5C>b<EFBFBD>h<EFBFBD><68><EFBFBD>g<EFBFBD>p<EFBFBD><70><EFBFBD>܂<EFBFBD><DC82>B<BR>
<UL>
<LI>add,sub,mult,div</LI><BLOCKQUOTE>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̃<EFBFBD><EFBFBD>\<5C>b<EFBFBD>h<EFBFBD>͐擪(<28>ō<EFBFBD>)<29>̐<EFBFBD><CC90><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̌<EFBFBD><CC8C><EFBFBD><EFBFBD><EFBFBD><EFBFBD>w<EFBFBD><77><EFBFBD>ł<EFBFBD><C582>܂<EFBFBD><DC82>B
<CODE><PRE>
BigDecimal("2").div(3,12) # 2.0/3.0 => 0.6666666666 67E0
</PRE></CODE>
</BLOCKQUOTE>
<LI>truncate,round,ceil,floor</LI><BLOCKQUOTE>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̃<EFBFBD><EFBFBD>\<5C>b<EFBFBD>h<EFBFBD>͏<EFBFBD><CD8F><EFBFBD><EFBFBD>_<EFBFBD><5F><EFBFBD><EFBFBD><EFBFBD>̑<EFBFBD><CC91>Έʒu<CA92><75><EFBFBD>w<EFBFBD><EFBFBD>Č<EFBFBD><C48C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
<CODE><PRE>
BigDecimal("6.66666666666666").round(12) # => 0.6666666666 667E1
</PRE></CODE>
</BLOCKQUOTE>
</UL>
<H3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ő<EFBFBD><EFBFBD>x<EFBFBD><EFBFBD><EFBFBD>R<EFBFBD><EFBFBD><EFBFBD>g<EFBFBD><EFBFBD><EFBFBD>[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></H3>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ő<EFBFBD><EFBFBD>x(<28>L<EFBFBD><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<29><><EFBFBD>R<EFBFBD><52><EFBFBD>g<EFBFBD><67><EFBFBD>[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EA8D87> add<64>Asub<75>Amult<6C>Adiv <20><><EFBFBD>̃<EFBFBD><CC83>\<5C>b<EFBFBD>h
<EFBFBD><EFBFBD><EFBFBD>g<EFBFBD>p<EFBFBD>ł<EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B
<EFBFBD>ȉ<EFBFBD><EFBFBD>̉~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>v<EFBFBD>Z<EFBFBD><5A><EFBFBD><EFBFBD><EFBFBD>v<EFBFBD><76><EFBFBD>O<EFBFBD><4F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̂悤<CC82>ɁA
<EFBFBD><EFBFBD><EFBFBD>߂錅<EFBFBD><EFBFBD><EFBFBD>͎<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŏw<EFBFBD><EFBFBD><EFBFBD>Ƃ<EFBFBD><EFBFBD>ł<EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B
<BR><BR>
<CODE><PRE>
#!/usr/local/bin/ruby
require "bigdecimal"
#
# Calculates 3.1415.... (the number of times that a circle's diameter
# will fit around the circle) using J. Machin's formula.
#
def big_pi(sig) # sig: Number of significant figures
exp = -sig
pi = BigDecimal::new("0")
two = BigDecimal::new("2")
m25 = BigDecimal::new("-0.04")
m57121 = BigDecimal::new("-57121")
u = BigDecimal::new("1")
k = BigDecimal::new("1")
w = BigDecimal::new("1")
t = BigDecimal::new("-80")
while (u.nonzero? && u.exponent >= exp)
t = t*m25
u = t.div(k,sig)
pi = pi + u
k = k+two
end
u = BigDecimal::new("1")
k = BigDecimal::new("1")
w = BigDecimal::new("1")
t = BigDecimal::new("956")
while (u.nonzero? && u.exponent >= exp )
t = t.div(m57121,sig)
u = t.div(k,sig)
pi = pi + u
k = k+two
end
pi
end
if $0 == __FILE__
if ARGV.size == 1
print "PI("+ARGV[0]+"):\n"
p big_pi(ARGV[0].to_i)
else
print "TRY: ruby pi.rb 1000 \n"
end
end
</PRE></CODE>
<HR>
<FONT size=2>
<I>
<A HREF="http://www.tinyforest.gr.jp">
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ΗY
</A>
(E-Mail:<A HREF="mailto:shigeo@tinyforest.gr.jp">&ltshigeo@tinyforest.gr.jp&gt</U></A>)
</I>
</FONT>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>