21 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto 8956c5abb5 mruby.h: include mruby/presym.h for all source files
Since presym is now mandatory, mruby.h includes presym.h so that
MRB_SYM() macros are available everywhere without explicit include.
Remove redundant #include <mruby/presym.h> from all source files.

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-09 16:50:58 +09:00
Yukihiro "Matz" Matsumoto cba7ecd65f mruby-cmath: use MRB_SYM() and mrb_define_module_function_id()
unified declaration and initialization of cmath variable.
used mrb_define_module_id for module definition.
optimized all 18 function definitions with symbol id api.

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-08 23:55:23 +09:00
Yukihiro "Matz" Matsumoto 07b803e28a docs: replace xml-style markup with markdown in comments
Replace XML-style markup tags in comments with markdown equivalents:
- <code>...</code> to `...` (inline code)
- <tt>...</tt> to `...` (teletype/monospace)
- <i>...</i> to *...* (italics/emphasis)
- +...+ to `...` (parameter/variable references)

Updated 80+ files across core source, headers, mrbgems, and libraries
to use consistent markdown formatting in documentation comments.
Handled edge cases including special characters like <=> operators.

Co-authored-by: Atlassian Rovo Dev
2025-08-14 10:52:49 +09:00
Yukihiro "Matz" Matsumoto a791069abd mruby-cmath: add comprehensive call-seq documentation for all methods
Added complete call-seq documentation for all 17 public methods in the
CMath module, improving documentation coverage from 0% to 100%.

Documentation includes:
- Method signatures with parameter and return types
- Clear descriptions of mathematical operations
- Branch cut information for complex functions
- Practical examples showing real and complex number usage
- Consistent formatting following mruby documentation standards

Methods documented:
- Exponential and logarithmic: exp, log, log2, log10, sqrt
- Trigonometric: sin, cos, tan, asin, acos, atan
- Hyperbolic: sinh, cosh, tanh, asinh, acosh, atanh

This significantly improves maintainability and usability of the complex
math functionality for developers working with mathematical computations
in embedded Ruby environments.

Co-authored-by: Atlassian Rovo Dev
2025-07-15 11:54:12 +09:00
Yukihiro "Matz" Matsumoto 1beecb9670 mruby-cmath: add README.md
The document is written by Google Jules.
2025-06-08 17:04:05 +09:00
esotericpig bfc9742848 Add Emscripten toolchain & build_config 2025-03-07 12:39:54 -10:00
Yukihiro "Matz" Matsumoto 2f7f797473 remove extra spaces before ; 2023-05-22 12:05:35 +09:00
Yukihiro "Matz" Matsumoto 2768fd62a0 Reduce calls to mrb_obj_is_kind_of() 2023-02-15 11:45:10 +09:00
John Bampton ea8964ef35 ruby: standardize whitespace 2022-10-31 16:25:56 +10:00
dearblue bbb04d257f Add default sauce to #add_dependency 2022-10-21 22:27:20 +09:00
dearblue f81bc3de38 Fixed compile error for mrbgems/mruby-cmath with clang++
If the preprocessor check part is only `__clang__`, CI's such as `Ubuntu-2004-clang` will fail to compile.
This is why we limited the addition to FreeBSD and OpenBSD, which have `clang++` in their base systems.
DragonFly BSD and NetBSD have GCC built into their base systems, so nothing is changed.
2021-11-28 17:28:44 +09:00
dearblue 5a57602860 Organize the include of header files
- `#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.
2021-08-21 15:42:57 +09:00
John Bampton be40e9c783 chore: fix spelling
Normally a single spell checker can't find all the mistakes or check all types of code.

These mistakes were found by another spell checker inside my editor with a more manual sift / find.
2021-02-13 17:21:17 +10:00
Yukihiro "Matz" Matsumoto 530afca2d7 Move F(x) definition inside of #ifdef; fix #5330 2021-02-07 15:28:23 +09:00
Yukihiro "Matz" Matsumoto ef8f475722 MinGW does not need MSVC hack.
Both MinGW and MSVC provide _WIN32 macro.
2021-02-06 19:30:59 +09:00
Yukihiro "Matz" Matsumoto 88113df098 Fixed compile errors in cmath.c in MinGW and macOS. 2021-02-06 17:00:03 +09:00
Yukihiro "Matz" Matsumoto 4bf4650321 Avoid implicit conversion from mrb_float to mrb_complex. 2021-02-06 00:50:13 +09:00
Yukihiro "Matz" Matsumoto 8ecd38d648 Reimplement complex division. 2021-02-06 00:40:18 +09:00
Yukihiro "Matz" Matsumoto ea0737ecfd Define M_E for some platforms. 2021-02-06 00:39:53 +09:00
Yukihiro "Matz" Matsumoto a6994f51c8 Update mruby-cmath to support MSVC complex.
* Use `_Complex` instead of `complex` (MSYS2 do not support `complex`)
* Use `_Dcomplex` instead of `_Complex` on MSCV
* Avoid operator division and multiplication of complex
2021-02-06 00:08:25 +09:00
Yukihiro "Matz" Matsumoto a0050541d1 Add mruby-cmath gem to the core.
This gem uses C99 `_Complex` features. You need a C compiler that
supports `_Complex` to enable this gem. All `gcc`, `clang`, `VC` support
`_Complex` so there should not be a big problem.
2021-02-05 22:27:27 +09:00