Class CeL.data.math.quotient
quotient 的 functions
Defined in: quotient.origin.js.
Constructor Attributes | Constructor Name and Description |
---|---|
CeL.data.math.quotient(numerator, denominator, approximate)
有理數 rational number,有理数全体のつくる集合はしばしば、商を意味する quotient の頭文字をとり、太字の Q で表す。
若要輸入不同基底的數值,請用 parse_base() |
Field Attributes | Field Name and Description |
---|---|
測試大小
|
|
四則運算 + - * / (+-×÷)**[=]
|
|
<static> |
CeL.data.math.quotient.digit_char
數字集
|
最簡分數/化簡, 約分 reduction
|
|
<static> |
CeL.data.math.quotient.repetend_separator
循環節分隔符號: {String} 整數.
|
依指定基底轉成循環小數 circulating decimal / repeating decimal。
特殊情況可以考慮使用 .toString(),會快很多。
TODO: 小數
|
|
為十進位最佳化的 to_base()
以結論來說,好像快不了多少? |
|
顯示成各種不同模式的數字
|
Method Attributes | Method Name and Description |
---|---|
<static> |
CeL.data.math.quotient.parse_base(number, base, digit_char)
轉換指定進位的數字成為 quotient 物件
|
Class Detail
CeL.data.math.quotient(numerator, denominator, approximate)
有理數 rational number,有理数全体のつくる集合はしばしば、商を意味する quotient の頭文字をとり、太字の Q で表す。
若要輸入不同基底的數值,請用 parse_base()
若要輸入不同基底的數值,請用 parse_base()
CeL.log((new CeL.quotient(3,4)).count('*',new CeL.quotient(2,7)).reduce().to_print_mode());
- Parameters:
- numerator
- 分子
- denominator
- 分母
- {Boolean} approximate
- 取近似值
Field Detail
{Number}
compare_to
測試大小
count
四則運算 + - * / (+-×÷)**[=]
<static>
CeL.data.math.quotient.digit_char
數字集
- See:
- Numerical digit
reduce
最簡分數/化簡, 約分 reduction
<static>
CeL.data.math.quotient.repetend_separator
循環節分隔符號: {String} 整數.小數__repetend_separator__循環節
to_base
依指定基底轉成循環小數 circulating decimal / repeating decimal。
特殊情況可以考慮使用 .toString(),會快很多。
TODO: 小數
- Since:
- 2004/7/9 13:28
to_decimal
為十進位最佳化的 to_base()
以結論來說,好像快不了多少?
以結論來說,好像快不了多少?
- Since:
- 2004/7/9 13:47
{String}
to_print_mode
顯示成各種不同模式的數字
- Since:
- 2004/7/9 14:23
Method Detail
<static>
CeL.data.math.quotient.parse_base(number, base, digit_char)
轉換指定進位的數字成為 quotient 物件
var q=parse_base('10000.'+_.repetend_separator+'3',11); if(!q) alert('bad input!'); else library_namespace.debug('
'+q.base(8)+','+q.base()+' , '+q.to_print_mode()+','+q.print(1)+','+q.to_print_mode(2)+','+q.to_print_mode(3,0,'',5));
- Parameters:
- number
- 數字
- base
- 基底
- digit_char
- 循環小數 digit 字集
- Since:
- 2004/7/9 16:13
- Returns:
- 回傳 quotient 物件,請用 quotient.to_base() 傳回所欲之 base