File: coerce

package info (click to toggle)
libdb2-ruby 0.5.4-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,352 kB
  • ctags: 2,743
  • sloc: ansic: 11,156; ruby: 6,199; cpp: 6,064; makefile: 86; sh: 31
file content (19 lines) | stat: -rw-r--r-- 682 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<entry index='c'>
<name>Coerce</name>
<reference>instance</reference>
<reference>method</reference>
<reference>ruby</reference>
<content>
    ((Method)) of converting type of numerical value.
    The numeric calculation method is set on, when
    the ((instance|Instance)) which it doesn't know is passed as an argument,
    which the coerce method is used to convert it.
    The coerce method returns a pair of
    given (, and converted) value and
    itself (a converted value, if necessary), as its arguments.

    The converting order of numerical types of the library of ((Ruby)) is
    as follows:
        Fixnum -> Bignum -> Rational -> Float -> Complex
</content>
</entry>