08-19-2020 10:13 AM
Can any one help?
I see the SGL icon which converts a number to Single Precision Float.
But I cannot see how to convert a 32 bit Single Precision Float back to a number.
08-19-2020 10:15 AM
Do you by 'number' mean some integer? A float is a number. 🙂
If so, It's any of the to Ixx or Uxx functions. The most common one would be to I32.
08-19-2020 10:43 AM
I may have it all wrong. The SGL icon is on second look probably not what I need.
What I a looking for is to convert to and from a number in IEEE-754 Floating Point.
the number input could be any real number.
08-19-2020 10:48 AM
I think a valid question here - perhaps even a better one is, "Why do you have to do this?"
08-19-2020 11:15 AM
john@crane wrote:
I may have it all wrong. The SGL icon is on second look probably not what I need.
What I a looking for is to convert to and from a number in IEEE-754 Floating Point.
the number input could be any real number.
SGLs represent "real numbers" (quantized to their inherent binary resolution). There is nothing to "convert".
You really need to explain the problem better. What do you define as "real number" in the above sentence:
08-19-2020 12:54 PM - edited 08-19-2020 12:56 PM
john@crane wrote:
What I a looking for is to convert to and from a number in IEEE-754 Floating Point.
the number input could be any real number.
Convert to and from what IEEE-745? As all the floating point numeric types below are IEEE-745 types.
08-19-2020 02:38 PM
And if it isn't obvious from the table that RTSLVU posted, LabVIEW Sgl is IEEE-754 Binary32, LabVIEW Dbl is IEEE-754 Binary64, and LabVIEW Ext is IEEE-754 Binary128.
Many of us "standardize" on Dbl for Reals.
Bob Schor
08-19-2020 03:26 PM
08-19-2020 07:27 PM
john@crane wrote:
Found solution at:
There is no way we could have known that this is what you are looking for. You never mentioned "binary" or "boolean" anywhere here.
Re-reading your questions, you wanted to "convert a number" (and never explain what you mean by that!). Your link shows how to convert properly formed boolean arrays (representing 32bits) to a SGL. Who would have guessed!? 😮 Boolean arrays are not "numbers" by most definitions!
08-20-2020 09:30 AM
@altenbach wrote:
There is no way we could have known that this is what you are looking for. You never mentioned "binary" or "boolean" anywhere here.
Re-reading your questions, you wanted to "convert a number" (and never explain what you mean by that!). Your link shows how to convert properly formed boolean arrays (representing 32bits) to a SGL. Who would have guessed!? 😮 Boolean arrays are not "numbers" by most definitions!
As an FPGA programmer, I am not sure how to feel.... 🤔