Skip to content

Subtraction fails for large numbers #51

Description

@seanmkauffman

Applying a numeric function (at least subtraction, possibly others) to numbers large enough to overflow an int will fail. The following code should output 10.0 but actually outputs 0.0.

import ca.uqac.lif.cep.util.Numbers;
import ca.uqac.lif.cep.functions.Function;

public class TestDiff {
	public static void main(String[] args) {
		Function negation = Numbers.subtraction;
		Object[] out = new Object[1];
		negation.evaluate(new Object[]{1590785415514L, 1590785415504L}, out);
		System.out.println("The return value of the function is: " + out[0]);
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions