Re: [sympy] Inconsistency between mathematical functions

2023-06-19 Thread Aaron Meurer
The automatic evalf logic in Function only calls evalf if every
argument is a float. It wasn't really designed for functions like
besselj where one argument is supposed to be an integer. It should
probably be updated to also automatically evalf if one argument is a
float and the rest are integers.

Aaron Meurer

On Mon, Jun 19, 2023 at 5:29 PM David Bailey  wrote:
>
> I wonder if anyone here can explain why some mathematical functions -
> e.g. sin and gamma evaluate completely if given a floating point
> argument, while others such as besselj(0,0.2) only evaluate completely
> if .evalf() is used.
>
> Is this behaviour intentional?
>
> Best Wishes,
>
> David
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sympy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/5da9b23e-4e62-9ff4-c643-8aa973b379c8%40dbailey.co.uk.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6Luo60%2BwxYeNMvyb_%2B1qmAt%2BGpiH5f82%3DdCCJJ22mnoHQ%40mail.gmail.com.


Re: [sympy] Inconsistency between mathematical functions

2023-06-20 Thread David Bailey

On 20/06/2023 00:47, Aaron Meurer wrote:

The automatic evalf logic in Function only calls evalf if every
argument is a float. It wasn't really designed for functions like
besselj where one argument is supposed to be an integer. It should
probably be updated to also automatically evalf if one argument is a
float and the rest are integers.


Thanks Aaron for your fast reply!

I did wonder if I should replace the first argument by 0.0, but that 
felt rather weird.


I hope nobody objects to that change.

David

--
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/4a6e7dbb-4c4b-dd58-1196-05f5e23a2a8d%40dbailey.co.uk.