Thread overview
How many bytes in a real ?
Aug 24, 2015
Guillaume Chatelet
Aug 24, 2015
rsw0x
Aug 24, 2015
Guillaume Chatelet
Aug 24, 2015
Guillaume Chatelet
Aug 25, 2015
Dmitry Olshansky
Aug 25, 2015
Dmitry Olshansky
Aug 24, 2015
rsw0x
Aug 25, 2015
Xinok
Aug 25, 2015
Guillaume Chatelet
August 24, 2015
On linux x86_64 : real.sizeof == 16 but it looks like only the first the first 10 bytes are used (ie. 80bits)

Is there a way to know the real size of a real ?
August 24, 2015
On Monday, 24 August 2015 at 21:55:40 UTC, Guillaume Chatelet wrote:
> On linux x86_64 : real.sizeof == 16 but it looks like only the first the first 10 bytes are used (ie. 80bits)
>
> Is there a way to know the real size of a real ?

http://dlang.org/type.html
	largest FP size implemented in hardwareImplementation Note: 80 bits for x86 CPUs or double size, whichever is larger
August 24, 2015
On Monday, 24 August 2015 at 21:58:48 UTC, rsw0x wrote:
> On Monday, 24 August 2015 at 21:55:40 UTC, Guillaume Chatelet wrote:
>> On linux x86_64 : real.sizeof == 16 but it looks like only the first the first 10 bytes are used (ie. 80bits)
>>
>> Is there a way to know the real size of a real ?
>
> http://dlang.org/type.html
> 	largest FP size implemented in hardwareImplementation Note: 80 bits for x86 CPUs or double size, whichever is larger

Yep I found this, I'd like to know this information at compile time.
August 24, 2015
On Monday, 24 August 2015 at 22:08:03 UTC, Guillaume Chatelet wrote:
> On Monday, 24 August 2015 at 21:58:48 UTC, rsw0x wrote:
>> On Monday, 24 August 2015 at 21:55:40 UTC, Guillaume Chatelet wrote:
>>> On linux x86_64 : real.sizeof == 16 but it looks like only the first the first 10 bytes are used (ie. 80bits)
>>>
>>> Is there a way to know the real size of a real ?
>>
>> http://dlang.org/type.html
>> 	largest FP size implemented in hardwareImplementation Note: 80 bits for x86 CPUs or double size, whichever is larger
>
> Yep I found this, I'd like to know this information at compile time.

I actually found another way(1) but if someone knows how to get this information at compile time I'm still interested. Thx !

1. https://github.com/D-Programming-Language/dmd/pull/4952
August 24, 2015
On Monday, 24 August 2015 at 22:08:03 UTC, Guillaume Chatelet wrote:
> On Monday, 24 August 2015 at 21:58:48 UTC, rsw0x wrote:
>> On Monday, 24 August 2015 at 21:55:40 UTC, Guillaume Chatelet wrote:
>>> On linux x86_64 : real.sizeof == 16 but it looks like only the first the first 10 bytes are used (ie. 80bits)
>>>
>>> Is there a way to know the real size of a real ?
>>
>> http://dlang.org/type.html
>> 	largest FP size implemented in hardwareImplementation Note: 80 bits for x86 CPUs or double size, whichever is larger
>
> Yep I found this, I'd like to know this information at compile time.

Oh, my apologies. I've looked around and I can't seem to find anything.
Sorry for the noise.
August 25, 2015
On Monday, 24 August 2015 at 21:55:40 UTC, Guillaume Chatelet wrote:
> On linux x86_64 : real.sizeof == 16 but it looks like only the first the first 10 bytes are used (ie. 80bits)
>
> Is there a way to know the real size of a real ?

The best I can think of is to use the mant_dig property which returns the number of bits in the mantissa.

http://dpaste.dzfl.pl/9889b3d0bd5b
August 25, 2015
On 25-Aug-2015 01:29, Guillaume Chatelet wrote:
> On Monday, 24 August 2015 at 22:08:03 UTC, Guillaume Chatelet wrote:
>> On Monday, 24 August 2015 at 21:58:48 UTC, rsw0x wrote:
>>> On Monday, 24 August 2015 at 21:55:40 UTC, Guillaume Chatelet wrote:
>>>> On linux x86_64 : real.sizeof == 16 but it looks like only the first
>>>> the first 10 bytes are used (ie. 80bits)
>>>>
>>>> Is there a way to know the real size of a real ?
>>>
>>> http://dlang.org/type.html
>>>     largest FP size implemented in hardwareImplementation Note: 80
>>> bits for x86 CPUs or double size, whichever is larger
>>
>> Yep I found this, I'd like to know this information at compile time.
>
> I actually found another way(1) but if someone knows how to get this
> information at compile time I'm still interested. Thx !
>
> 1. https://github.com/D-Programming-Language/dmd/pull/4952

real.sizeof ?

-- 
Dmitry Olshansky
August 25, 2015
On 25-Aug-2015 08:28, Dmitry Olshansky wrote:
> On 25-Aug-2015 01:29, Guillaume Chatelet wrote:
>> On Monday, 24 August 2015 at 22:08:03 UTC, Guillaume Chatelet wrote:
>>> On Monday, 24 August 2015 at 21:58:48 UTC, rsw0x wrote:
>>>> On Monday, 24 August 2015 at 21:55:40 UTC, Guillaume Chatelet wrote:
>>>>> On linux x86_64 : real.sizeof == 16 but it looks like only the first
>>>>> the first 10 bytes are used (ie. 80bits)
>>>>>
>>>>> Is there a way to know the real size of a real ?
>>>>
>>>> http://dlang.org/type.html
>>>>     largest FP size implemented in hardwareImplementation Note: 80
>>>> bits for x86 CPUs or double size, whichever is larger
>>>
>>> Yep I found this, I'd like to know this information at compile time.
>>
>> I actually found another way(1) but if someone knows how to get this
>> information at compile time I'm still interested. Thx !
>>
>> 1. https://github.com/D-Programming-Language/dmd/pull/4952
>
> real.sizeof ?
>

NVM

-- 
Dmitry Olshansky
August 25, 2015
On Tuesday, 25 August 2015 at 00:13:28 UTC, Xinok wrote:
> On Monday, 24 August 2015 at 21:55:40 UTC, Guillaume Chatelet wrote:
>> On linux x86_64 : real.sizeof == 16 but it looks like only the first the first 10 bytes are used (ie. 80bits)
>>
>> Is there a way to know the real size of a real ?
>
> The best I can think of is to use the mant_dig property which returns the number of bits in the mantissa.
>
> http://dpaste.dzfl.pl/9889b3d0bd5b

Thx for the proposal. I actually found this in std.math which confirms this is indeed a possibility.
https://github.com/D-Programming-Language/phobos/blob/6681862b4e3a77004e8d6ec1f62cf6587e20f6d4/std/math.d#L228