08-17-2009 02:26 PM
TonP wrote:Zero sets all units to infinity.
I guess that would count as a bug.
Now I have become curious how LV pulls this off. I chose to stick to ascii in my example since it is a (very inefficient) method to hold arbitrary precision numbers. Now I can wire a control with the value of 1.1 (or something similar) with no exact FP representation. I pass this control to an indicator and I get back 1.1 and not 1.099999999 or whatever? I assume it is the FP value that is passed. Is it really simple and I am missing something?
08-17-2009 02:44 PM
Darin.K wrote:
TonP wrote:Zero sets all units to infinity.
I guess that would count as a bug.
Now I have become curious how LV pulls this off. I chose to stick to ascii in my example since it is a (very inefficient) method to hold arbitrary precision numbers. Now I can wire a control with the value of 1.1 (or something similar) with no exact FP representation. I pass this control to an indicator and I get back 1.1 and not 1.099999999 or whatever? I assume it is the FP value that is passed. Is it really simple and I am missing something?
Yes you are missing something.
You get the actual text that is inside the control, for instance if you have configured the control to display engineering format or even worse use ',' as the decimal sign the result will be quite shocking.
LabVIEW has some quite intelligent number displaying routines, these are allways hard to do for really floating number representation. I believe a log of all the Excel bugs are in those routines.
For instance writing 1.9 you want to see 1.9. However sending 1.99999999999995, you normally want to see 2, LabVIEW per default goes for 6 digits of precision, beyond that it normally removes the digits.
Relying on this functionality is very bug throne, a user will click some day the control and change it's representation, or it is used on a non '.' language, the code will output a wrong value. It is also waiting for a race condition to happen:
Ton
08-17-2009 03:00 PM
TonP wrote:
LabVIEW has some quite intelligent number displaying routines, these are allways hard to do for really floating number representation. I believe a log of all the Excel bugs are in those routines.
Thanks for confirming my suspicion that a lot goes on inside the controls/indicators. The quirks with using the text I can deal since I mostly use this technique in personal VIs. If someone starts messing with the controls, I know who to flog. My primary goal is to utilize the cleverness of the NI engineers who designed the number displaying routines.
10-10-2014 12:40 AM
Where is the I32 numeric and I32 float located on the function palette? (For some context, I am creating a random number generator with a max of 6 and min of 1. I am new to LabVIEW)
10-10-2014 12:56 AM