digitalmars.D - Anyone knows this issue? std/math.d(2759): Error: number '0x1p-1024'
- Martin Nowak (6/6) Jun 19 2015 I'm getting this error while trying to build the relase.
- John Colvin (3/10) Jun 19 2015 See http://forum.dlang.org/post/mjjfjr$nlk$1@digitalmars.com and
- Andrei Alexandrescu (13/26) Jun 19 2015 Links taken from the new forum interface seem useless. Neither of these
- John Colvin (4/14) Jun 19 2015 This seems to be specific to the vertical-split layout. Works
- Andrei Alexandrescu (3/9) Jun 19 2015 This is happening on my older CentOS as well, it's a problem in the C
- Martin Nowak (5/7) Jun 20 2015 Even more worrisome, I don't understand why dmd is compiling the
- Andrei Alexandrescu (2/7) Jun 20 2015 I think it's just tokenizing them that triggers the errors. -- Andrei
- Walter Bright (3/9) Jun 20 2015 Which C runtime are you using? The math functions in C runtimes are ofte...
- Martin Nowak (2/4) Jun 20 2015 Debian 7.4, there is nothing I can do to avoid glibc.
- Martin Nowak (4/7) Jun 20 2015 So we now call the host's C library to perform constant folding/CTFE of ...
- Iain Buclaw via Digitalmars-d (9/16) Jun 20 2015 exp?
- Walter Bright (14/30) Jun 20 2015 The code is the following, in lexer.c:
- Walter Bright (2/3) Jun 20 2015 We already do our own strtold(), so it should be straightforward.
- Martin Nowak (2/7) Jun 20 2015 Thanks, I'll work on a fix.
- Martin Nowak (4/12) Jun 20 2015 I can't use the strtold_dm from the backend, b/c it's not available for
- Walter Bright (3/6) Jun 20 2015 Hmm. Perhaps google for similar code that would be available? Or submit ...
- Martin Nowak (3/10) Jun 20 2015 Might work, as the issue dates back to 2013, I'd say we skip it
- Walter Bright (3/15) Jun 20 2015 Ironically, this just appeared:
- Iain Buclaw via Digitalmars-d (6/36) Jun 20 2015 Ah yes, that brings back memories of fixing GDC to set errno = ERANGE if
- Martin Nowak (2/4) Jun 20 2015 The function returns a float, so errno seems like the better choice.
- Iain Buclaw via Digitalmars-d (5/10) Jun 20 2015 It's at this point which I say it's a longdouble for GDC. Incase I need ...
I'm getting this error while trying to build the relase. std/math.d(2759): Error: number '0x1p-1024' is not representable I'm getting that while compiling a -m32 (X86) static release phobos library, but I can't reproduce the error using the same command. https://github.com/D-Programming-Language/phobos/blob/abb21ab9bcd3857f1567bfde11c2d5d385f5caf0/std/math.d#L2759 Don't even know why the unittests are compiled.
Jun 19 2015
On Friday, 19 June 2015 at 16:19:05 UTC, Martin Nowak wrote:I'm getting this error while trying to build the relase. std/math.d(2759): Error: number '0x1p-1024' is not representable I'm getting that while compiling a -m32 (X86) static release phobos library, but I can't reproduce the error using the same command. https://github.com/D-Programming-Language/phobos/blob/abb21ab9bcd3857f1567bfde11c2d5d385f5caf0/std/math.d#L2759 Don't even know why the unittests are compiled.See http://forum.dlang.org/post/mjjfjr$nlk$1 digitalmars.com and http://forum.dlang.org/post/fbkyfjfofwaoitaxdply forum.dlang.org
Jun 19 2015
On 6/19/15 9:34 AM, John Colvin wrote:On Friday, 19 June 2015 at 16:19:05 UTC, Martin Nowak wrote:Links taken from the new forum interface seem useless. Neither of these go nowhere relevant (nor does the one posted by Martin). I'm using the vertical split layout if that matters. In related news: the fact that I need to point to the post I want to see with Ctrl-Up and Ctrl-Down, and THEN press Enter like an idiot to see it is definitely not working out for me. I understand it saves bandwidth, but if most bandwidth savings come from nobody using the interface then it's no gain to anyone. Please have the message viewer follow the list focus. cc Vladimir Thanks, AndreiI'm getting this error while trying to build the relase. std/math.d(2759): Error: number '0x1p-1024' is not representable I'm getting that while compiling a -m32 (X86) static release phobos library, but I can't reproduce the error using the same command. https://github.com/D-Programming-Language/phobos/blob/abb21ab9bcd3857f1567bfde11c2d5d385f5caf0/std/math.d#L2759 Don't even know why the unittests are compiled.See http://forum.dlang.org/post/mjjfjr$nlk$1 digitalmars.com and http://forum.dlang.org/post/fbkyfjfofwaoitaxdply forum.dlang.org
Jun 19 2015
On Friday, 19 June 2015 at 16:59:20 UTC, Andrei Alexandrescu wrote:On 6/19/15 9:34 AM, John Colvin wrote:This seems to be specific to the vertical-split layout. Works fine in the other 3 layouts.On Friday, 19 June 2015 at 16:19:05 UTC, Martin Nowak wrote:Links taken from the new forum interface seem useless. Neither of these go nowhere relevant (nor does the one posted by Martin). I'm using the vertical split layout if that matters.[...]See http://forum.dlang.org/post/mjjfjr$nlk$1 digitalmars.com and http://forum.dlang.org/post/fbkyfjfofwaoitaxdply forum.dlang.org
Jun 19 2015
On 6/19/15 9:18 AM, Martin Nowak wrote:I'm getting this error while trying to build the relase. std/math.d(2759): Error: number '0x1p-1024' is not representable I'm getting that while compiling a -m32 (X86) static release phobos library, but I can't reproduce the error using the same command. https://github.com/D-Programming-Language/phobos/blob/abb21ab9bcd3857f1567bfde11c2d5d385f5caf0/std/math.d#L2759 Don't even know why the unittests are compiled.This is happening on my older CentOS as well, it's a problem in the C library. I suggest we just version those tests. -- Andrei
Jun 19 2015
On 06/19/2015 06:54 PM, Andrei Alexandrescu wrote:This is happening on my older CentOS as well, it's a problem in the C library. I suggest we just version those tests. -- AndreiEven more worrisome, I don't understand why dmd is compiling the unittests at all. Might be related to https://issues.dlang.org/show_bug.cgi?id=14431 or https://issues.dlang.org/show_bug.cgi?id=14508.
Jun 20 2015
On 6/20/15 2:30 AM, Martin Nowak wrote:On 06/19/2015 06:54 PM, Andrei Alexandrescu wrote:I think it's just tokenizing them that triggers the errors. -- AndreiThis is happening on my older CentOS as well, it's a problem in the C library. I suggest we just version those tests. -- AndreiEven more worrisome, I don't understand why dmd is compiling the unittests at all.
Jun 20 2015
On 6/19/2015 9:18 AM, Martin Nowak wrote:I'm getting this error while trying to build the relase. std/math.d(2759): Error: number '0x1p-1024' is not representable I'm getting that while compiling a -m32 (X86) static release phobos library, but I can't reproduce the error using the same command. https://github.com/D-Programming-Language/phobos/blob/abb21ab9bcd3857f1567bfde11c2d5d385f5caf0/std/math.d#L2759 Don't even know why the unittests are compiled.Which C runtime are you using? The math functions in C runtimes are often inadequate.
Jun 20 2015
On 06/20/2015 09:52 AM, Walter Bright wrote:Which C runtime are you using? The math functions in C runtimes are often inadequate.Debian 7.4, there is nothing I can do to avoid glibc.
Jun 20 2015
On 06/20/2015 09:52 AM, Walter Bright wrote:Which C runtime are you using? The math functions in C runtimes are often inadequate.So we now call the host's C library to perform constant folding/CTFE of exp? This is a point for Iain's proposal to use a high precision floating point implementation in the compiler to avoid machine/platform differences.
Jun 20 2015
On 20 Jun 2015 11:35, "Martin Nowak via Digitalmars-d" < digitalmars-d puremagic.com> wrote:On 06/20/2015 09:52 AM, Walter Bright wrote:exp?Which C runtime are you using? The math functions in C runtimes are often inadequate.So we now call the host's C library to perform constant folding/CTFE ofThis is a point for Iain's proposal to use a high precision floating point implementation in the compiler to avoid machine/platformdifferences. I thought dmd used the C library implementations for all intrinsics via CTFE, not just exp? In any case, isn't the problem you are seeing related to the conversion of string to float? Which again dmd is at the mercy of the C library implementation to handle correctly.
Jun 20 2015
On 6/20/2015 2:48 AM, Iain Buclaw via Digitalmars-d wrote:On 20 Jun 2015 11:35, "Martin Nowak via Digitalmars-d" <digitalmars-d puremagic.com <mailto:digitalmars-d puremagic.com>> wrote: > > On 06/20/2015 09:52 AM, Walter Bright wrote: > > > > Which C runtime are you using? The math functions in C runtimes are > > often inadequate. > > So we now call the host's C library to perform constant folding/CTFE of exp? > This is a point for Iain's proposal to use a high precision floating > point implementation in the compiler to avoid machine/platform differences. I thought dmd used the C library implementations for all intrinsics via CTFE, not just exp? In any case, isn't the problem you are seeing related to the conversion of string to float? Which again dmd is at the mercy of the C library implementation to handle correctly.The code is the following, in lexer.c: errno = 0; (void)Port::strtod((char *)stringbuffer.data, NULL); if (errno == ERANGE) { const char *suffix = (result == TOKfloat32v || result == TOKimaginary32v) ? "f" : ""; error(scanloc, "number '%s%s' is not representable", (char *)stringbuffer.data, suffix); } The point of the Port:: code is to correct for inadequacies of various C standard library implementations, in this case Debian 7.4. Apparently we need to roll our own version of strtod() and put it in Port.
Jun 20 2015
On 6/20/2015 3:06 AM, Walter Bright wrote:Apparently we need to roll our own version of strtod() and put it in Port.We already do our own strtold(), so it should be straightforward.
Jun 20 2015
On 06/20/2015 12:06 PM, Walter Bright wrote:On 6/20/2015 3:06 AM, Walter Bright wrote:Thanks, I'll work on a fix.Apparently we need to roll our own version of strtod() and put it in Port.We already do our own strtold(), so it should be straightforward.
Jun 20 2015
On 06/20/2015 02:00 PM, Martin Nowak wrote:On 06/20/2015 12:06 PM, Walter Bright wrote:I can't use the strtold_dm from the backend, b/c it's not available for the other compilers, and AFAIU licensing doesn't allow me to move it to the frontend.On 6/20/2015 3:06 AM, Walter Bright wrote:Thanks, I'll work on a fix.Apparently we need to roll our own version of strtod() and put it in Port.We already do our own strtold(), so it should be straightforward.
Jun 20 2015
On 6/20/2015 5:16 AM, Martin Nowak wrote:I can't use the strtold_dm from the backend, b/c it's not available for the other compilers, and AFAIU licensing doesn't allow me to move it to the frontend.Hmm. Perhaps google for similar code that would be available? Or submit a bug report to the Debian folks?
Jun 20 2015
On Saturday, 20 June 2015 at 17:04:48 UTC, Walter Bright wrote:On 6/20/2015 5:16 AM, Martin Nowak wrote:Might work, as the issue dates back to 2013, I'd say we skip it for this release and fix it independently.I can't use the strtold_dm from the backend, b/c it's not available for the other compilers, and AFAIU licensing doesn't allow me to move it to the frontend.Hmm. Perhaps google for similar code that would be available?
Jun 20 2015
On 6/20/2015 5:16 AM, Martin Nowak wrote:On 06/20/2015 02:00 PM, Martin Nowak wrote:Ironically, this just appeared: https://www.reddit.com/r/programming/comments/3aif1a/visual_c_strtod_still_broken/On 06/20/2015 12:06 PM, Walter Bright wrote:I can't use the strtold_dm from the backend, b/c it's not available for the other compilers, and AFAIU licensing doesn't allow me to move it to the frontend.On 6/20/2015 3:06 AM, Walter Bright wrote:Thanks, I'll work on a fix.Apparently we need to roll our own version of strtod() and put it in Port.We already do our own strtold(), so it should be straightforward.
Jun 20 2015
On 20 June 2015 at 12:06, Walter Bright via Digitalmars-d < digitalmars-d puremagic.com> wrote:On 6/20/2015 2:48 AM, Iain Buclaw via Digitalmars-d wrote:Ah yes, that brings back memories of fixing GDC to set errno = ERANGE if casting the result from 160bits down returns Infinity. Can we make this a boolean check removing the need for me to explicitly set errno?On 20 Jun 2015 11:35, "Martin Nowak via Digitalmars-d" <digitalmars-d puremagic.com <mailto:digitalmars-d puremagic.com>> wrote: > > On 06/20/2015 09:52 AM, Walter Bright wrote: > > > > Which C runtime are you using? The math functions in C runtimes are > > often inadequate. > > So we now call the host's C library to perform constant folding/CTFE of exp? > This is a point for Iain's proposal to use a high precision floating > point implementation in the compiler to avoid machine/platform differences. I thought dmd used the C library implementations for all intrinsics via CTFE, not just exp? In any case, isn't the problem you are seeing related to the conversion of string to float? Which again dmd is at the mercy of the C library implementation to handle correctly.The code is the following, in lexer.c: errno = 0; (void)Port::strtod((char *)stringbuffer.data, NULL); if (errno == ERANGE)
Jun 20 2015
On 06/20/2015 01:35 PM, Iain Buclaw via Digitalmars-d wrote:Can we make this a boolean check removing the need for me to explicitly set errno?The function returns a float, so errno seems like the better choice.
Jun 20 2015
On 20 June 2015 at 14:03, Martin Nowak via Digitalmars-d < digitalmars-d puremagic.com> wrote:On 06/20/2015 01:35 PM, Iain Buclaw via Digitalmars-d wrote:It's at this point which I say it's a longdouble for GDC. Incase I need to remind people that there are no uses of native FP whatsoever in my compiler. :-)Can we make this a boolean check removing the need for me to explicitlyseterrno?The function returns a float, so errno seems like the better choice.
Jun 20 2015