summaryrefslogtreecommitdiffhomepage
path: root/src/fmt_fp.c
AgeCommit message (Collapse)Author
2021-07-26fmt_fp.c: add implicit cast from `mrb_float` to `int8_t`.Yukihiro "Matz" Matsumoto
2021-07-25Remove redundant include headers.Yukihiro "Matz" Matsumoto
- stdlib.h - stddef.h - stdint.h - stdarg.h - limits.h - float.h
2021-06-16Run pre-commit with GitHub ActionsJohn Bampton
Running pre-commit with GitHub Actions now gives us more tests and coverage Remove duplicate GitHub Actions for merge conflicts and trailing whitespace Remove duplicate checks for markdownlint and yamllint from the GitHub Super-Linter Add new custom pre-commit hook running with a shell script to sort alphabetically and uniquify codespell.txt Add new pre-commit hook to check spelling with codespell https://github.com/codespell-project/codespell Fix spelling
2021-05-26fmt_fp.c: move mruby specific `mrb_float_to_str` to `numeric.c`Yukihiro "Matz" Matsumoto
2021-05-25fmt_fp.c: truncate precision to prevent buffer overflow.Yukihiro "Matz" Matsumoto
2021-05-25fmt_fp.c: use constant that depends on `mrb_float` size.Yukihiro "Matz" Matsumoto
2021-05-25fmt_fp.c: use a const int instead of a macro constant.Yukihiro "Matz" Matsumoto
2021-05-24fmt_fp.c: exponential may be bigger than `100`.Yukihiro "Matz" Matsumoto
2021-05-22Fix typo in `src/fmt_fp.c` [ci skip]KOBAYASHI Shuji
2021-05-22fp_fmt.c: remove `mrb_float_to_cstr()`.Yukihiro "Matz" Matsumoto
The function was intended to be a utility function for `mruby-sprintf`. The functionality was integrated into `sprintf.c`.
2021-05-22fmt_fp.c: replace with public domain float format routine; ref #5448Yukihiro "Matz" Matsumoto
The original code can be found in `https://github.com/dhylands/format-float`. Changes: - support `double` - support `#` (alt_form) modifier - small refactoring
2021-05-21fmt_fp.c: remove `fmt` argument from `mrb_float_to_str()`.Yukihiro "Matz" Matsumoto
With major refactoring to prepare removing `snprintf(3) calls.
2021-05-21numeric.h: remove 2 functions from `MRB_API`Yukihiro "Matz" Matsumoto
- `mrb_float_to_str()` - `mrb_float_to_cstr()` Both functions will be replaced to support new coming `format-float.c`.
2021-04-16feat(CI): add the GitHub Super LinterJohn Bampton
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
2021-01-02Avoid double inclusion on `<mruby.h>`.Yukihiro "Matz" Matsumoto
2020-11-26Include `mruby.h` instead of `mrbconf.h` directly.Yukihiro "Matz" Matsumoto
2020-11-24Add `#include <mrbconf.h>` at the head of `fmt_fp.c`; #5185Yukihiro "Matz" Matsumoto
2020-11-21Rename `MRB_{ENABLE,DISABLE}_` to `MRB_{USE,NO}_`; close #5163KOBAYASHI Shuji
| Previous Name | New Name | |------------------------------|-------------------------| | MRB_ENABLE_ALL_SYMBOLS | MRB_USE_ALL_SYMBOLS | | MRB_ENABLE_SYMBOLL_ALL | MRB_USE_ALL_SYMBOLS | | MRB_ENABLE_CXX_ABI | MRB_USE_CXX_ABI | | MRB_ENABLE_CXX_EXCEPTION | MRB_USE_CXX_EXCEPTION | | MRB_ENABLE_DEBUG_HOOK | MRB_USE_DEBUG_HOOK | | MRB_DISABLE_DIRECT_THREADING | MRB_NO_DIRECT_THREADING | | MRB_DISABLE_STDIO | MRB_NO_STDIO | | ENABLE_LINENOISE | MRB_USE_LINENOISE | | ENABLE_READLINE | MRB_USE_READLINE | | DISABLE_MIRB_UNDERSCORE | MRB_NO_MIRB_UNDERSCORE | | DISABLE_GEMS | MRB_NO_GEMS | * `MRB_ENABLE_SYMBOLL_ALL` seems to be a typo, so it is fixed. * `MRB_` prefix is added to those without. * The previous names can also be used for compatibility.
2020-10-12Rename float configuration option names.Yukihiro "Matz" Matsumoto
- `MRB_WITHOUT_FLOAT` => `MRB_NO_FLOAT` - `MRB_USE_FLOAT` => `MRB_USE_FLOAT32` The former is to use `USE_XXX` naming convention. The latter is to make sure `float` is 32bit float and not floating point number in general.
2020-06-05Add proper cast.Yukihiro "Matz" Matsumoto
2020-06-05Add proper casts to silence VC warnings.Yukihiro "Matz" Matsumoto
2020-04-11Add `mrb_float_to_cstr()` MRB_API functiondearblue
In order to share the same operation with `mrb_float_to_str()`, the internal structure is modified.
2020-04-11Supports some specifier flags with `mrb_float_to_str()`dearblue
Changed to understand `#`, `0`, `-`, ` ` and `+`. Based on src/stdio/vfprintf.c in git://git.musl-libc.org/musl
2020-04-11Supports width specifier with `mrb_float_to_str()`dearblue
Based on src/stdio/vfprintf.c in git://git.musl-libc.org/musl
2020-04-11Add missing `MRB_API`dearblue
2020-01-01Do not include `stdint.h` before `mruby.h`; ref #4750dearblue
2019-04-03Modify `#else` and `#endif` annotations in `src/fmt_fp.c` [ci skip]KOBAYASHI Shuji
2019-03-15Use `fmt_fp()` for portable float representation.Yukihiro "Matz" Matsumoto
2018-11-07Wrong pool data length for negative floating value in a mrb file.Hiroshi Mimaki
2018-08-01Simply use `snprintf` instead of custom `fmt_fp`,Yukihiro "Matz" Matsumoto
Unless `MRB_DISABLE_STDIO` is set. `snprintf` is used anyway if mruby is configured to use `stdio`. This change reduces 8KB of program size on the Linux box.
2017-11-04Avoid compiling `fmt_fp.c` if `MRB_WITHOUT_FLOAT` is set; #3827Yukihiro "Matz" Matsumoto
2017-08-25fix fmt_fp.c(329) : warning C4244: 'return' : conversion from 'ptrdiff_t' to ↵Tomasz Dąbrowski
'int', possible loss of data
2017-08-25fix fmt_fp.c(251) : warning C4244: '=' : conversion from '__int64' to 'int', ↵Tomasz Dąbrowski
possible loss of data
2017-08-25fix fmt_fp.c(224) : warning C4244: '=' : conversion from 'ptrdiff_t' to ↵Tomasz Dąbrowski
'int', possible loss of data
2017-08-25fix fmt_fp.c(220) : warning C4244: '=' : conversion from '__int64' to 'int', ↵Tomasz Dąbrowski
possible loss of data
2017-08-25fix fmt_fp.c(206) : warning C4244: 'initializing' : conversion from ↵Tomasz Dąbrowski
'ptrdiff_t' to 'int', possible loss of data
2017-08-25fix fmt_fp.c(178) : warning C4244: 'return' : conversion from 'ptrdiff_t' to ↵Tomasz Dąbrowski
'int', possible loss of data
2017-08-25fix fmt_fp.c(123) : warning C4244: 'return' : conversion from 'ptrdiff_t' to ↵Tomasz Dąbrowski
'int', possible loss of data
2017-08-19Reduce signed/unsigned warnings in dump.cYukihiro "Matz" Matsumoto
2017-08-19Reduce signed/unsigned warnings in fmt_fp.cYukihiro "Matz" Matsumoto
2017-08-19Use `ptrdiff_t` instead of `int`.Yukihiro "Matz" Matsumoto
2017-08-18Separate `mrb_str_buf_new` and `mrb_str_new_capa`.Yukihiro "Matz" Matsumoto
`mrb_str_buf_new` is an old function that ensures capacity size of `MRB_STR_BUF_MIN_SIZE` minimum. Usually one need to use `mrb_str_new_capa` instead.
2017-08-12Reduce integer type mismatch warnings in VC.Yukihiro "Matz" Matsumoto
2016-09-28Removed trailing spacesNobuyoshi Nakada
2015-12-22fix build on VS2012Yasuhiro Matsumoto
2015-11-27include changed from by quotes ("") to by brackets (<>); close #3032Yukihiro "Matz" Matsumoto
2015-07-29always call frexp() instead of frexpl()cremno
No values that can only be represented as long double are passed since mrb_float is either float or double.
2015-07-1664bit Cygwin also doesn't have frexpl(3)takkaw
2015-07-06fix androideabi cross-compile error : undefined reference to 'frexpl'xuejianqing
2015-06-06Fix build on MIPS of linuxNobuhiro Iwamatsu
MIPS of Linux platform is supported frexpl(3). This fixes to use the frexpl that are provided with gcc if user wants to build on MIPS of Linux platform. Signe-doff-by: Nobuhiro Iwamatsu <[email protected]>