Skip to content

interpret(): Combined fractions lead to wrong Output #18

@limosoft-de

Description

@limosoft-de

Expected behaviour: When passing "1 1/2" to interpret(), the expected output would be 1.5

Actual behaviour: When passing "1 1/2" to interpret(), the actual output is 5.5

Code example:

import 'package:test/test.dart';
import 'package:function_tree/function_tree.dart';

void main() {
  test('Test interpret()', () {
    String s = "1 1/2";
    num n = s.interpret();
    expect(n, 1.5); //this will not pass as n==5.5
  });
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions