Fix double macro argument reference causing double yield in [SD]Float#map#11
Conversation
22995a4 to
c1a8483
Compare
|
I saw that the commitlint workflow failed, so I reworded messages without squashing any commits. If you prefer, I can merge all of the commits into two -- one to create the failing test, and one to add the fix. |
| #define m_ldexp(x, y) ldexp(x, y) | ||
| #define m_frexp(x, exp) frexp(x, exp) | ||
|
|
||
| static inline dtype na_ruby_num_to_flt(VALUE x) { |
There was a problem hiding this comment.
This gem usually uses the f_ prefix for inline function naming. It would be great if you could change this to f_num_to_data.
|
@mike-bourgeous Thank you for finding and fixing this bug. I was looking into why it does not occur with numo-narray v0.9.2.1. The change to the >>> import numpy as np
>>> np.array([1, None, 1], dtype=np.float32)
array([ 1., nan, 1.], dtype=float32)The commitlint workflow is failing again, but I believe it will pass if you make the entire commit message lowercase. |
This fixes double-yielding in Numo::SFloat#map and Numo::DFloat#map.
c1a8483 to
58b303f
Compare
|
@yoshoku I have applied your suggestions and will be sure to set up your git hooks if I make any future contributions. Let me know if anything else is required for this PR. |
|
@mike-bourgeous I have released this fix as v0.10.5. Thanks so much for your help 🤝 |
|
@yoshoku Awesome, thank you! Happy to help. |


Purpose
This pull request proposes a fix for #10, where
Numo::SFloat#mapandNumo::DFloat#mapwould yield each value to the block twice.Summary of Changes
m_num_to_datamacro infloat_macro.hwith an inline functionmapcalls its blockTesting
repro.rbprintsFAILwithout the change and now printsPASSrake testfails without the change and passes with the changeRelated Issues
Closes #10