| Age | Commit message (Collapse) | Author |
|
Since they are basically duplicated functionality. `mrb_as_float` is now
a macro defined using `mrb_ensure_float_type`; #5620
|
|
It should only call `to_f` for Rational and Complex numbers.
Ref #5540 #5613 #5620
|
|
|
|
|
|
- `#include <math.h>` is done in `mruby.h`.
Eliminate the need to worry about the `MRB_NO_FLOAT` macro.
- Include mruby header files before standard header files.
If the standard header file is already placed before `mruby.h`, the standard header file added in the future tends to be placed before `mruby.h`.
This change should some reduce the chances of macros that must be defined becoming undefined in C++ or including problematic header files in a particular mruby build configuration.
|
|
|
|
`-1 * (1<<63)` causes overflow, but `-1<<63` is a valid value.
|
|
|
|
This reverts commit 3738d62a86a54524d5d7738ddbafe4700ca6a889.
The change changed the behavior with floating point numbers.
|
|
|
|
Use `mrb_fixnum_value()` only when you are absolutely sure that the
value is within `Fixnum` range, i.e. 31 bits signed integer at least.
|
|
The `Fixnum` class is no longer provided by `mruby`.
|
|
|
|
|
|
|
|
|
|
- stdlib.h
- stddef.h
- stdint.h
- stdarg.h
- limits.h
- float.h
|
|
|
|
- String#__lines
- Array#__ary_eq
- Array#__ary_cmp
- Hash#__delete
- Kernel#__case_eqq
- Integer#__coerce_step_counter
|
|
- `truncate`
- `floor`
- `ceil`
`round` already takes `ndigits`.
|
|
`mrb_float_to_str()` used to take `fmt` argument. We thought no one used
the function, and OK to remove the argument. But at least `mruby-redis`
gem used the function.
|
|
|
|
* refactor `mrb_integer_to_str()`
* refactor `mrb_str_format()`
|
|
|
|
With major refactoring to prepare removing `snprintf(3) calls.
|
|
Consistent number conversion function names:
* `mrb_value` to immediate (C) value
* `mrb_int()` -> `mrb_as_int()`
* `mrb_to_flo()` -> `mrb_as_float()`
* `mrb_value` to `mrb_value` (converted)
* `mrb_to_int()'
* `mrb_Integer()` - removed
* `mrb_Float()` -> `mrb_to_float`
Consistent function name (avoid `_flo` suffix):
* `mrb_div_flo()` -> `mrb_div_float`
|
|
|
|
|
|
Following functions are defined in `mrblib/numeric.c`:
- `Integer#ceil`
- `Integer#floor`
- `Integer#round`
- `Integer#truncate`
|
|
|
|
|
|
|
|
The GitHub Super Linter is a more robust and better supported
tool than the current GitHub Actions we are using.
Running these checks:
ERROR_ON_MISSING_EXEC_BIT: true
VALIDATE_BASH: true
VALIDATE_BASH_EXEC: true
VALIDATE_EDITORCONFIG: true
VALIDATE_MARKDOWN: true
VALIDATE_SHELL_SHFMT: true
VALIDATE_YAML: true
https://github.com/marketplace/actions/super-linter
https://github.com/github/super-linter
Added the GitHub Super Linter badge to the README.
Also updated the pre-commit framework and added
more documentation on pre-commit.
Added one more pre-commit check: check-executables-have-shebangs
Added one extra check for merge conflicts to our
GitHub Actions.
EditorConfig and Markdown linting.
Minor grammar and spelling fixes.
Update linter.yml
|
|
- `mrb_num_div_int(mrb,x,y)` -> `mrb_div_int(mrb,x,y)`
- `mrb_num_div_flo(mrb,x,y)` -> `mrb_div_flo(x,y)`
They are internal function not supposed to be used outside of the core.
|
|
- define `MRB_TT_COMPLEX`
- change object structure (`struct RComplex`)
- add memory management for `MRB_TT_COMPLEX`
- avoid operator overloading as much as possible
- as a result, performance improved a log
- should work with and without `Rational` defined
|
|
- define `MRB_TT_RATIONAL`
- change object structure (`struct RRational`)
- add memory management for `MRB_TT_RATIONAL`
- avoid operator overloading as much as possible
- implement division overloading in C
- as a result, performance improved a lot
|
|
Since `mruby` does not have `Bignum`, `Float#divmod` could overflow, so
it will return `Float` values when the divided value does not fit in
`mrb_int`. This behavior will be changed when `Bignum` is introduced to
`mruby` in the future.
|
|
|
|
#### Before this patch:
```console
$ bin/mruby -e 'p(Float::NAN/0)'
Infinity
```
#### After this patch (same as Ruby):
```console
$ bin/mruby -e 'p(Float::NAN/0)'
NaN
```
|
|
|
|
|
|
This reverts commit dc51d89ac22acc60b9bfeed87115863565b74085.
|
|
Instead of including `mruby/presym.h` everywhere, we provided the
fallback `mruby/presym.inc` under `include/mruby` directory, and specify
`-I<build-dir>/include` before `-I<top-dir>/include` in `presym.rake`.
So even when someone drops `-I<build-dir>/include` in compiler options,
it just compiles without failure.
|
|
https://github.com/shuujii/mruby into shuujii-avoid-including-presym.inc-in-existing-header-files
|
|
|
|
Thinking `Ratinal` and `Complex` in mind.
|
|
Addressed an issue where existing programs linking `libmruby.a` could only
be built by adding `<build-dir>/include` to compiler's include path.
|
|
|
|
Lint
|
|
Also added `no-float.rb` target in `build_config`.
|