LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Petru_Tarabuta

The "Random Number (Range)" polymorphic VI should have instances for all integer numeric types

Status: New

It's great that the native "Random Number (Range)" VI was added to LabVIEW relatively recently (LabVIEW 2020 I believe).

Currently the VI has instances only for U64, I64 and DBL, as seen below.
1.png

 

It would be great if it had instances for all integer types, especially for I32 which is probably the most common integer type. I am aware that we can easily convert from U64, I64 and DBL to any desired integer type, but it would be nice to remove the need to convert the output.

Thanks

3 Comments
Darren
Proven Zealot

The VIs were implemented this way to provide the maximum possible range for floating point numbers, signed integers, and unsigned integers. The coercion of scalar numerics isn't generally a problem in most applications.

 

If this idea gathers sufficient kudos then LV R&D can revisit that decision.

VijayanthRK
Member

The coercion of scalar numerics isn't generally a problem in most applications.

@Darren: If I have a large array of random numbers, which I then want to convert down to say, a I8, is it not less memory intensive to preallocate said array, use a for loop to generate a new random integer, and replace the corresponding element in the preallocated array, rather than using the DBL version of the above VI and adding a "I8" conversion node on the whole array?

There are more buffer allocations in the latter case than the former, right?

What Petru's idea does is it lets the former version be a part of the LabVIEW pallette as well, for all data types.

Darren
Proven Zealot

Allocations usually aren't a concern with small arrays of numerics. My intuition is that the generation of gigantic arrays of random numbers is not a common need.

But again, a large number of kudos on this idea would prompt R&D to revisit the decision I made when I originally added the Random Number (Range) VIs to LabVIEW.