www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - How many bytes in a real ?

reply "Guillaume Chatelet" <chatelet.guillaume gmail.com> writes:
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 ?
Aug 24 2015
next sibling parent reply "rsw0x" <anonymous anonymous.com> writes:
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
Aug 24 2015
parent reply "Guillaume Chatelet" <chatelet.guillaume gmail.com> writes:
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.
Aug 24 2015
next sibling parent reply "Guillaume Chatelet" <chatelet.guillaume gmail.com> writes:
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
Aug 24 2015
parent reply Dmitry Olshansky <dmitry.olsh gmail.com> writes:
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
Aug 24 2015
parent Dmitry Olshansky <dmitry.olsh gmail.com> writes:
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
Aug 24 2015
prev sibling parent "rsw0x" <anonymous anonymous.com> writes:
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.
Aug 24 2015
prev sibling parent reply "Xinok" <xinok live.com> writes:
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
Aug 24 2015
parent "Guillaume Chatelet" <chatelet.guillaume gmail.com> writes:
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
Aug 25 2015