fn_express 2.1.2
fn_express: ^2.1.2 copied to clipboard
A Dart package for parsing and evaluating mathematical expressions with support for variables, functions, constants, expression simplification, and symbolic differentiation.
example/fn_express_example.dart
import 'dart:io';
import 'package:fn_express/fn_express.dart';
void main() {
var isRunning = true;
final repl = Repl(
(output, {newline = true}) =>
newline ? stdout.writeln(output) : stdout.write(output),
);
while (isRunning) {
stdout.write('>> ');
final input = stdin.readLineSync();
(input == null || input.toLowerCase() == 'exit')
? isRunning = false
: repl(input);
}
}