취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

Single Precision Float

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.

0 포인트
1/15 메시지
5,048 조회수

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.

 

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

Qestit Systems
Certified-LabVIEW-Developer
0 포인트
2/15 메시지
5,043 조회수

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.  

 
 

 

0 포인트
3/15 메시지
5,024 조회수

I think a valid question here - perhaps even a better one is, "Why do you have to do this?"

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 포인트
4/15 메시지
5,020 조회수

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:

 

  • A numeric in one of the other representations (DBL, etc.)
  • A flattened string representing the bits in the four bytes of a SGL (given correct endian-ness)
  • A ASCII formatted string showing the number in human readable text consisting of characters 0..9, a decimal delimiter, and maybe an exponent delimiter?
  • Something else?

 

 

0 포인트
5/15 메시지
5,003 조회수

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.

 

IEECapture.PNG

========================
=== Engineer Ambiguously ===
========================
6/15 메시지
4,969 조회수

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

7/15 메시지
4,948 조회수
0 포인트
8/15 메시지
4,944 조회수

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!

0 포인트
9/15 메시지
4,904 조회수

@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.... 🤔

 

0 포인트
10/15 메시지
4,863 조회수