Is there a floatN_t type ?


 
Thread Tools Search this Thread
Top Forums Programming Is there a floatN_t type ?
# 8  
Old 06-05-2009
This is very platform-specific stuff. What platform are these odd floats coming from?
# 9  
Old 06-05-2009
Kinda. This data basically come out from embedded devices as messages and I later have to process them. The spec, which I don't have at my hand right now, actually specify how many bits are for the mantissa. The smallest is actually 8 bits in my case. I must say that spec is just a draft yet, so it might change.

Thanks for all the links and tips to all so far.

Always eager to learn,
S.
# 10  
Old 06-07-2009
The mantissa is just a portion of the number, so the whole thing could be quite a bit larger.
# 11  
Old 06-07-2009
Is the physical memory on that embedded device so scarce that you need to roll your own for floats...also the memory savings will slow down your application because of all the extra CPU cycles needed to do the conversion. Can you say how much phys mem is going to be on that device. This wasn't an issue even a couple of decades ago when there was a real shortage of memory in embedded systems.
# 12  
Old 06-07-2009
If I understood this correctly you are getting messages from an embedded device presumable in some kind of encoded struct but you are not actually coding on/for the embedded device.

If you are post-processing this on an "normal" PC you should just be decoding the messages and using the decoded content to do your processing. For example if you have an 8 bit float of some kind coming out from the device you would convert that and use a standard 32 bit float on your pc and ignore the fact that the data type is much bigger than you actually need.

Likewise is you need to send the information back to the device, you would need to reencode the message into a sequence of bytes and send that.

Adapting/converting the messages rather than reimplmenting the basic functionality will give you much better mileage.
# 13  
Old 06-08-2009
Quote:
Originally Posted by reborg
If I understood this correctly you are getting messages from an embedded device presumable in some kind of encoded struct but you are not actually coding on/for the embedded device.
That's right.

Quote:
Originally Posted by reborg
If you are post-processing this on an "normal" PC you should just be decoding the messages and using the decoded content to do your processing. For example if you have an 8 bit float of some kind coming out from the device you would convert that and use a standard 32 bit float on your pc and ignore the fact that the data type is much bigger than you actually need.
I'm not actually processing the data. I just have to display them (for analyzing),
but still I need a variable to contain them when I read the data from the file.

Quote:
Originally Posted by reborg
Likewise is you need to send the information back to the device, you would need to reencode the message into a sequence of bytes and send that.

Adapting/converting the messages rather than reimplmenting the basic functionality will give you much better mileage.
I don't need to resend it anywhere. I just need to contain them, and eventually display them.

I'm actually having the same problem with the integer being 128 bits long. stdint.h is
only able to handle up to uint64_t .

Thanks,
S.
# 14  
Old 06-08-2009
Can you show the struct encoding...maybe it needs to be decoded properly before displaying. An embedded device sending a 128-bit int...what OS and platform are you working on. Also provide some details on the embedded device in use.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Programming

Changing type name

In C++, how can I change the type with another name For example How can I declaring an object real which would be the same as declaring it float (5 Replies)
Discussion started by: kristinu
5 Replies

2. Windows & DOS: Issues & Discussions

Type of RAM

Hello All Is there a way I can find out the type of RAM (DDR1 or DDR2 or DDR3), I'm using withoout opening the cabinet? Any Windows command? Thanks in advance. (5 Replies)
Discussion started by: tenderfoot
5 Replies

3. UNIX for Dummies Questions & Answers

key_t type

I would like to print value of key generate like this.... key_t k = ftok(".",'c'); printf("key is %d \n" , k); Is there other way to print this type. I dont think I am getting right output which is key is 1662074913 (shouldn't it be 6362074913) since 'c' is 63 in hex (ascii table).... (2 Replies)
Discussion started by: joker40
2 Replies

4. UNIX for Dummies Questions & Answers

Encoding Type

Hi, Where can I find the encoding type in a unix server ? Thanks in advance !!! (1 Reply)
Discussion started by: risshanth
1 Replies

5. Solaris

raid type

how to get the raid type of a mount if I am using solaris disksuite? thanks (1 Reply)
Discussion started by: melanie_pfefer
1 Replies

6. Programming

array type has incomplete element type

Dear colleagues, One of my friend have a problem with c code. While compiling a c program it displays a message like "array type has incomplete element type". Any body can provide a solution for it. Jaganadh.G (1 Reply)
Discussion started by: jaganadh
1 Replies

7. Shell Programming and Scripting

String type to date type

Can one string type variable changed into the date type variable. (1 Reply)
Discussion started by: rinku
1 Replies

8. Shell Programming and Scripting

Different type of shells?

Hello there, i just want to know what are the different type of shells and the main difference betwee them. The problem is that if you try to search over the net you will find a lot of information and hence you will have no enough time to read all of them.....Anyone can help with this?? (1 Reply)
Discussion started by: charbel
1 Replies

9. UNIX for Dummies Questions & Answers

you have more and one unix type?

As a formem unix newbe I Just wanted to tell you about this cool site for all you confused people. If you need to support more than one unix type: Use this one. It's a life saver. http://www.unixguide.net/unixguide.shtml here (4 Replies)
Discussion started by: sunbird
4 Replies
Login or Register to Ask a Question