-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible factorial error. #75
Comments
Yes, this actually related to #64 see pull request #74, I just added a test for this and it seems to be resolved in that branch (https://travis-ci.org/dktcoding/exp4j/builds/182453474) |
case '!':
if (numArguments != 1) {
return BUILTIN[INDEX_FACTORIAL];
}
default:
return null;
This is the proposed fix correct? In this, would the numArguments be number of elements in the string to which I add operators and numbers?
…________________________________
From: Federico Vera <[email protected]>
Sent: Friday, December 9, 2016 5:43 AM
To: fasseg/exp4j
Cc: Anurag Joshi; Author
Subject: Re: [fasseg/exp4j] Possible factorial error. (#75)
Yes, this actually related to #64<#64> see pull request #74<#74>, I just added a test for this and it seems to be resolved in that branch (https://travis-ci.org/dktcoding/exp4j/builds/182453474)
-
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#75 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AQCtmLEEqwNlKGz4vZUp1KvjRfWys_rWks5rGJ0vgaJpZM4LIbDd>.
|
That's the special casing, the way it works is:
The problem is that this can't be done using an external That code you posted isn't from the original |
Hey Guys, |
Hey Guys, I added the tests from @dktcoding and it does produce the correct values. Am I missing something there or has this bug mysteriously disappeared? |
Hi.
I am not sure about this being a bug or not but I will put forward some of my findings.
So I defined the factorial method as given on [(http://www.objecthunter.net/exp4j/)].
I get an exception for 3!-2! but not for 3-2!(I get 1, as expected). But rightfully, (3!)-(2!) gives me the correct answer(i.e, 4).
What can be done in order for 3!-2! to work without having to enter brackets?
The text was updated successfully, but these errors were encountered: