Skip to content
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

linspaced_array returns int, but should return real #3022

Closed
bob-carpenter opened this issue Feb 6, 2024 · 1 comment · Fixed by #3023
Closed

linspaced_array returns int, but should return real #3022

bob-carpenter opened this issue Feb 6, 2024 · 1 comment · Fixed by #3023

Comments

@bob-carpenter
Copy link
Contributor

Description

The linspaced_array function returns integers when it should return real numbers.

Thanks to Rodrigo Silva for reporting on the forums.

Example

transformed data {
  array[5] real y = linspaced_array(5, 1.1, 5.5);
  print("y = ", y);
}

Output is:

Chain [3] y = [1,2,3,4,5]

Expected output

y = [1.1,2.2,3.3,4.4,5.5]

Current Version:

v4.8.1

@WardBrian
Copy link
Member

It seems like this was introduced in c3226b0 as a result of a misread review comment

The tests never directly assign this to std::vector<double>, but I'm still surprised they compiled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants