From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to multiply very small numbers withot round it to zero ?

Solved!
Go to solution

Hi  everyone

When I multiply  tow values one of them have very small numbers (import from Excel) labview round  them to zero . How would i stop it from happenning?

 

Thank you.

0 Kudos
Message 1 of 12
(3,862 Views)

We cannot tell from the picture, but is it also zero if you use a scientific display format?

 

(Please attach the VI and also include a typical data file)

0 Kudos
Message 2 of 12
(3,852 Views)

It's impossible to debug a picture.  Attach your VI and also the text file that contains your data.  That way we can see how small these numbers actually are.  LabVIEW doesn't just round small numbers to zero, so I think you've got something else going wrong in your program, either the way it is reading the text file, or the way you are displaying your results.

0 Kudos
Message 3 of 12
(3,847 Views)

Hi weaam,

 

please provide an example for your problem!

LabVIEW will not round to zero unless the numbers are VERY small in the order of 1E-323 for DBL values…

 

What formatting did you set for the array indicator you marked in your image?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 12
(3,846 Views)

If the values where really zero, all values after it would also be zero ("-10000000*V*exp(") or one ("p(D)" and "TCP"). 0X-10000000=0, exponential(zero)=1, 1*1=1...

 

It just shows as zero's, since the default formatting is not useful in your situation (like the others mentioned).

0 Kudos
Message 5 of 12
(3,759 Views)

altenbach , RavensFan and GerdW
thank you very much
the result is zero  when I use a scientific display format

 

0 Kudos
Message 6 of 12
(3,758 Views)

Hi weaam,

 

please attach images directly in this forum to be visible for everyone…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 12
(3,754 Views)

Make the values default, and post the saved VI... Or post the Vi and a data file. All kinds of things can be wrong, but we can't tell from an image.

0 Kudos
Message 8 of 12
(3,746 Views)

Vi and data file

Download All
0 Kudos
Message 9 of 12
(3,732 Views)
Solution
Accepted by topic author weaam

Hi weaam,

 

I don't see any errors in those calculations!

Either the volume is zero (most of the time) or you try to calculate e^x for very small x values (like -26000).

Example: for row 1300 you get a "Dose" value of 6500. Then you calc "-0.307*D*(1+D/300)", which results in -45231.33. Now take e^-45231: this will result in (basically) zero!

Which result do you expect for your input values?

 

Side note: Setting the indicators to 50 significant digits is nonsense for DBL values: they only support ~17 decimal digits!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 10 of 12
(3,722 Views)