summaryrefslogtreecommitdiffhomepage
path: root/src/numeric.c
AgeCommit message (Collapse)Author
2014-03-16float + nil should be raise TypeErrorksss
2014-03-16fix bug when `0 * other object`ksss
2014-03-16fix bug when `0 + other object`ksss
2014-03-11add MRB_INT_BITcremno
2014-03-08use NAN and INFINITYcremno
The macro str_to_mrb_float (strto[df]) converts a string to a number, but these two macros can be used to directly get the special value. The NAN macro requires quiet NaN support, but so does str_to_mrb_float. This change also circumvents missing C99 support in Microsoft's C library. Its (or ISO C90's) strtod doesn't parse "nan" or "inf".
2014-02-26resolve conflictYukihiro "Matz" Matsumoto
2014-02-25avoid accessing uninitialized string; ref ac936fcYukihiro "Matz" Matsumoto
2014-02-23move declaration to the top of the block; ref #1727Yukihiro "Matz" Matsumoto
2014-02-22preserve significands in float-string conversionh2so5
2014-02-22powered num may be infinite in float-string conversionYukihiro "Matz" Matsumoto
2014-02-18mrb_flo_to_str: internal linkagecremno
2014-02-17more mrb_flo_to_str fixescremno
- remove float check (take mrb_float instead of mrb_value) - support -0.0 - fix range error if log10 is called when n == 0.0 - MSVC older than 2013: add signbit macro (for double)
2014-02-17use double instead of mrb_float (that may be single precision float) to ↵Yukihiro "Matz" Matsumoto
reduce errors
2014-02-17remove trailing zeros from float string representationYukihiro "Matz" Matsumoto
2014-02-17define FLO_EPSILON depends on float/doubleYukihiro "Matz" Matsumoto
2014-02-17remove max_digit from mrb_flo_to_str()Yukihiro "Matz" Matsumoto
2014-02-17small refactoring; direct returnYukihiro "Matz" Matsumoto
2014-02-17use powf() instead of pow() on MRB_USE_FLOATYukihiro "Matz" Matsumoto
2014-02-17fdigit may be negative due to error if mrb_float is 32bit (e.g. 10**36 on ↵Yukihiro "Matz" Matsumoto
32bit arch); ref #1713 #1714
2014-02-17fix mrb_flo_to_str() exponent problemh2so5
2014-02-15modify mrb_to_str() in order to display big float numbertakkaw
2014-02-09Merge pull request #1674 from cremno/mrb_bool-FALSE-TRUEYukihiro "Matz" Matsumoto
use mrb_bool, FALSE and TRUE more
2014-02-06Merge pull request #1688 from cubicdaiya/issues/unnecessary_semicolonYukihiro "Matz" Matsumoto
Remove unnecessary semicolon
2014-02-06remove unnecessary semicoloncubicdaiya
2014-02-06use mrb_str_new_lit() more widelyYukihiro "Matz" Matsumoto
2014-02-03add Float#nan?Tomoyuki Sahara
2014-01-31use mrb_bool, FALSE and TRUE morecremno
It doesn't matter to me if one is using FALSE/TRUE instead of 1/0 but I prefer a type (alias) which emphasizes boolean vars to int. I changed 1/0 to FALSE/TRUE anyway.
2014-01-02remove various preprocessor conditionalscremno
- HAVE_IEEEFP_H is nowhere defined or needed at all - FreeBSD < 4 is unsupported since years - MSVC workaround (around what exactly?)
2013-12-19Fix typo from expornent to exponentNobuhiro Iwamatsu
Signed-off-by: Nobuhiro Iwamatsu <[email protected]>
2013-11-09Change supress to suppressCarson McDonald
2013-10-23fix #1542fleuria
2013-10-22move some methods to make floats and integers compatible [mruby special]Yukihiro "Matz" Matsumoto
2013-10-22implement some Numeric methods in RubyYukihiro "Matz" Matsumoto
2013-10-21implement Integer#succ in RubyYukihiro "Matz" Matsumoto
2013-10-20Fixnum#succ may overflowYukihiro "Matz" Matsumoto
2013-08-07class.c and numeric.c: fixed MSVC warningsCremno
2013-07-25replace assert with mrb_assertfleuria
2013-07-22change else formattingYukihiro "Matz" Matsumoto
2013-07-06Change width to size_t to fix warningCarson McDonald
2013-06-15Merge upstreamDaniel Bovensiepen
2013-06-17Add ISO Number to Numeric, Integer and FloatDaniel Bovensiepen
2013-06-08new is removed from Integer so doesn't need to be removed again in FixnumCarson McDonald
2013-05-26Add MRB_WORD_BOXING mode (represent mrb_value as a word)kimu_shu
2013-04-25rename every ARGS_XXX to MRB_ARGS_XXX; ref #1206Yukihiro "Matz" Matsumoto
2013-03-31Integer.round have no arg.Masaki Muranaka
2013-03-31Remove unused functions.Masaki Muranaka
2013-03-31Move Integer.{floor,ceil,round,truncate} to mrblib/. For maintainability.Masaki Muranaka
2013-03-31revive #to_intYukihiro "Matz" Matsumoto
2013-03-30move to_i from fixnum to integer; remove reference of to_int which is not in ISOYukihiro "Matz" Matsumoto
2013-03-30undef Integer#new; ref #1111Yukihiro "Matz" Matsumoto