BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code


@altenbach wrote:

@Yamaeda wrote:
If you add a U8 to a I32, to you explicitly convert the U8 first? 😉 I mean, the code is more correct, but the extra blocks makes it a little harder to read, since i always think "why are they doing this explicit conversion?".

In addition, an explicit conversion is sometimes more expensive. (Example, but you would think the compiler should create identical code. I have not tested in recent version) 


Debug still turned on? My impression was that the explicit conversion was making more places that could be probed, etc. With debugging off, I would expect identical code.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2631 of 2,635
(202 Views)

@crossrulz wrote:
With debugging off, I would expect identical code.

In principle, there is still an extra memory allocation of the lower DBL array while the multiplication might know how to multiply an integer with a DBL directly. No time for extensive tests at the moment ....

Message 2632 of 2,635
(188 Views)

@altenbach wrote:

@Yamaeda wrote:
If you add a U8 to a I32, to you explicitly convert the U8 first? 😉 I mean, the code is more correct, but the extra blocks makes it a little harder to read, since i always think "why are they doing this explicit conversion?".

In addition, an explicit conversion is sometimes more expensive. (Example, but you would think the compiler should create identical code. I have not tested in recent version)

 

CoercionIsFaster.png


Yeah i remember that little nugget. I assume it allocates a new array or something. Maybe Bool to number should have configurable output like the Multiply has?

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2633 of 2,635
(117 Views)

@Yamaeda wrote:
Maybe Bool to number should have configurable output like the Multiply has?

exactly 😄

0 Kudos
Message 2634 of 2,635
(107 Views)

@altenbach wrote:

@Yamaeda wrote:
Maybe Bool to number should have configurable output like the Multiply has?

exactly 😄


It was only suggested in 2009, give'em some time! 😉

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2635 of 2,635
(30 Views)