Skip to content

Releases: davidesantangelo/nmri

v0.2.0

Choose a tag to compare

@davidesantangelo davidesantangelo released this 05 Dec 08:51

Added

  • New math functions: log10(x), log2(x) for logarithms
  • Factorial function: fact(n) with overflow protection
  • Hyperbolic functions: sinh(x), cosh(x), tanh(x)
  • Angle conversion: deg(x) (radians→degrees), rad(x) (degrees→radians)
  • CLI flags: --version / -v and --help / -h
  • NMRI_VERSION macro for centralized version management

Changed

  • Function map now uses static const for better optimization
  • Complete reserved word checking (all functions + constants)
  • Improved help screen with compact function listing
  • Code refactoring for better maintainability

Fixed

  • Incomplete reserved word check that allowed overwriting some constants

v0.1.3

Choose a tag to compare

@davidesantangelo davidesantangelo released this 05 Apr 09:10

Fixed

  • Renamed MAX_INPUT macro to NMRI_MAX_INPUT to prevent macro name conflicts with system headers.
  • Replaced all occurrences of MAX_INPUT throughout the codebase.
  • Prevented compiler warnings about macro redefinition.

v0.1.2

Choose a tag to compare

@davidesantangelo davidesantangelo released this 01 Apr 09:14

Added

  • Command-line expression evaluation: You can now pass an expression directly as command-line arguments (e.g., nmri 1 + 2 * 3 or nmri "5 * (2 + 3)") for quick calculations without entering the interactive mode. The program evaluates the expression and exits. If no expression arguments are provided, it enters the standard interactive mode.

Fixed

  • Restored full implementations for core parsing and evaluation functions (tokenize, shunting_yard, evaluate_postfix, evaluate_expression, handle_assignment, process_command, readCommand, etc.), fixing numerous -Wunused-parameter warnings caused by previous dummy implementations used for brevity.
  • Removed unused opt variable declaration in main, fixing a -Wunused-variable warning.

v0.1.1

Choose a tag to compare

@davidesantangelo davidesantangelo released this 31 Mar 07:20

[0.1.1] - 2025-03-31

Fixed

  • Corrected division (/) and modulo (%) operations to properly handle division by exactly zero. This prevents potential errors and inaccurate results that could occur due to floating-point representation issues near zero.
  • Ensured that the special ans variable and the internal memory of the last result are updated only after a variable assignment (e.g., x = 1 + 2) is fully and successfully completed.

Changed

  • Improved the internal parsing logic for unary plus (+) and minus (-) operators for better consistency and potentially simpler evaluation flow.

Code Quality

  • Minor internal code formatting adjustments and comment updates for clarity.
  • Added the definition for an internal helper function (clean_near_zero) that was previously missing.