Thread overview | |||||
---|---|---|---|---|---|
|
October 09, 2008 "float" on 3 bytes | ||||
---|---|---|---|---|
| ||||
Hi, I need to minimize the size of my memory use... My program uses a big array of float. My float have a gap of 0.0000001 and 65536. So i think to store one sort of "float" with : - an "ushort" to have numbers - and a "ubyte" to have the number of digit in the decimal portion (or something like this...). What could be the better way for you ? Thanks in advance for your help, TSalm |
October 10, 2008 Re: "float" on 3 bytes | ||||
---|---|---|---|---|
| ||||
Posted in reply to tsalm | On Thu, 09 Oct 2008 20:59:17 +0400, tsalm <tsalm@free.fr> wrote:
> Hi,
>
> I need to minimize the size of my memory use...
> My program uses a big array of float.
> My float have a gap of 0.0000001 and 65536.
>
> So i think to store one sort of "float" with :
> - an "ushort" to have numbers
> - and a "ubyte" to have the number of digit in the decimal portion (or something like this...).
>
> What could be the better way for you ?
>
> Thanks in advance for your help,
> TSalm
There are 24- and 16-bit floating point type libraries available in C (google for half-float), these could be easily ported to D.
|
October 10, 2008 Re: "float" on 3 bytes | ||||
---|---|---|---|---|
| ||||
Posted in reply to Denis Koroskin | >> Hi,
>>
>> I need to minimize the size of my memory use...
>> My program uses a big array of float.
>> My float have a gap of 0.0000001 and 65536.
>>
>> So i think to store one sort of "float" with :
>> - an "ushort" to have numbers
>> - and a "ubyte" to have the number of digit in the decimal portion (or something like this...).
>>
>> What could be the better way for you ?
>>
>> Thanks in advance for your help,
>> TSalm
>
>
> There are 24- and 16-bit floating point type libraries available in C (google for half-float), these could be easily ported to D.
Interesting. Thanks
|
Copyright © 1999-2021 by the D Language Foundation