Mercurial > jwe > octave
changeset 24158:f9549e90d620
integral3.m: Return single type output if an input is of single type (bug #52243).
* integral3.m: Check for any limit of integration (x, y, or z) being of type single.
If found, cast xa, xb limits of integration to single. This will signal to
downstream quadrature routines to use single variables.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 18 Oct 2017 21:59:38 -0700 |
parents | 5fc5c1a49aa1 |
children | c4dac7a0da7e |
files | scripts/general/integral3.m |
diffstat | 1 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/general/integral3.m Wed Oct 18 21:35:15 2017 -0700 +++ b/scripts/general/integral3.m Wed Oct 18 21:59:38 2017 -0700 @@ -147,7 +147,14 @@ || (! is_function_handle (za) && isa (za, "single")) || (! is_function_handle (zb) && isa (zb, "single"))); - ## Set defaults, update with any specified parameters. + ## Communicate to downstream quadrature routines that at least one limit of + ## integration was of single type by casting xa, xb to single. + if (issingle) + xa = single (xa); + xb = single (xb); + endif + + ## Set default tolerances, and then update with any specified parameters. if (issingle) abstol = 1e-5; reltol = 1e-4;