search for: strtod

Displaying 20 results from an estimated 198 matches for "strtod".

Did you mean: strtol
2016 Dec 20
2
Very small numbers in hexadecimal notation parsed as zero
...the three examples below: as.double("0x1.00000000d0000p-987") # should be 7.645296e-298 as.double("0x1.0000000000000p-1022") # should be 2.225074e-308 as.double("0x1.f89fc1a6f6613p-974") # should be 1.23456e-293 The culprit seems to be the src/main/util.c:R_strtod function and in some cases, removing the zeroes directly before the 'p' leads to correct parsing: as.double("0x1.00000000dp-987") # 7.645296e-298, as expected as.double("0x1.p-1022") # 2.225074e-308, as expected I wrote a small program (in a file called &...
2014 Apr 30
2
make fullcheck fails: strtod/atof and locale
make fullcheck fails on my computer: flac cannot recognize --skip option that contains decimal point, e.g. "--skip=1.234". System locale uses comma as a separator, so strtod/atof expect comma, not point, and "make fullcheck" fails. Here's what I can see in FLAC source code: atof() function found in: file: src/share/grabbag/seektable.c function: grabbag__seektable_convert_specification_to_template() (option: -S) strtod() function found in: src/fla...
2014 Dec 06
2
GCC/clang compilation issues
...but I hit one roadblock with GCC and clang: src/lib/libflac/libFLAC/stream_encoder.c:1696:43: error: cast from function call of type 'double' to non-matching type 'FLAC__int32' (aka 'int') [-Werror,-Wbad-function-cast] ...FLAC__int32 tukey_parts = (FLAC__int32)strtod(specification+14, 0); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ src/lib/libflac/libFLAC/stream_encoder.c:1717:43: error: cast from function call of type 'double' to non-matching type 'FLAC__int32' (aka 'int') [-Werror,-Wbad-function-...
2014 Dec 06
2
GCC/clang compilation issues
...gt; > > src/lib/libflac/libFLAC/stream_encoder.c:1696:43: error: cast from function call > > of type 'double' to non-matching type 'FLAC__int32' (aka 'int') > > [-Werror,-Wbad-function-cast] > > ...FLAC__int32 tukey_parts = (FLAC__int32)strtod(specification+14, 0); > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > > src/lib/libflac/libFLAC/stream_encoder.c:1717:43: error: cast from function call > > of type 'double' to non-matching type 'FLAC__int32' (aka 'int')...
2007 Jul 14
3
Strange C programming problem
...to test something, and it keeps giving the wrong result. I'm not inexperienced in C, but I can't believe strtof (et al) are broken, so I must be doing something wrong. However, I've spent hours looking at this and comparing it to the man pages and don't see what I'm doing wrong. strtod() and strtold() also give equally wrong results. (the example program given on the strotd man page works fine, BTW.) Can someone wield a clue-bat please? :) Here's the program: #include <stdio.h> #include <math.h> #include <stdlib.h> #include <errno.h> int main (int...
2014 Sep 22
3
[PATCH] apodization for struct CompressionLevels
Op 22-09-14 om 21:56 schreef Erik de Castro Lopo: > Wouldn't "tukey(1/2)" be better? > > Erik 5e-1 is directly parsed by strtod, while 1/2 isn't AFAIK.
2005 Dec 19
0
new(er) SEC driver.
...ome problem */ upsdebugx(SEC_LOG_ERROR, "Error parsing number for %s (%s)", sec_varlist[varnum].name, value); return; } snprintf(buf, SEC_SIZE, "\"%d\" (Integer)", i); dstate_setinfo(sec_varlist[varnum].infotag, "%d", i); } else { d = strtod(value, &s); if ((s == value) || (*s != '\0')) { /* some problem */ upsdebugx(SEC_LOG_ERROR, "Error parsing number for %s (%s)", sec_varlist[varnum].name, value); return; } d = d * sec_varlist[varnum].unit; snprintf(buf, SEC_SIZE, "\"%.1f\&quot...
2014 Dec 07
2
GCC/clang compilation issues
> I don't know, its your build system and I haven't seen it, nor do > I have the time and motivation to look at it (unless of course you > were paying me for my time). I willing give my time to maintain > FLAC. I have not signed up to spend my time on your project. And I am willing to looking at FLAC and spent my time to fix compiler warnings to make it more portable and
2014 Dec 06
0
GCC/clang compilation issues
...ith GCC and clang: > > src/lib/libflac/libFLAC/stream_encoder.c:1696:43: error: cast from function call > of type 'double' to non-matching type 'FLAC__int32' (aka 'int') > [-Werror,-Wbad-function-cast] > ...FLAC__int32 tukey_parts = (FLAC__int32)strtod(specification+14, 0); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > src/lib/libflac/libFLAC/stream_encoder.c:1717:43: error: cast from function call > of type 'double' to non-matching type 'FLAC__int32' (aka 'int') > [-We...
2010 Nov 19
3
File Offsets for SCP (patch)
...) != -1) + while ((ch = getopt(argc, argv, "dfl:prtvBCc:i:P:q1246S:o:F:A:Z:")) != -1) switch (ch) { /* User-visible flags. */ case '1': @@ -407,6 +411,16 @@ main(int argc, char **argv) setmode(0, O_BINARY); #endif break; + case 'A': + fd_offset = strtod(optarg, &endp); + if (fd_offset < 0 || *endp != '\0') + usage(); + break; + case 'Z': + fd_inset = strtod(optarg, &endp); + if (fd_inset < 0 || *endp != '\0') + usage(); + break; defau...
2005 Apr 17
3
RFC: hexadecimal constants and decimal points
These are some points stimulated by reading about C history (and related in their implementation). 1) On some platforms > as.integer("0xA") [1] 10 but not all (not on Solaris nor Windows). We do not define what is allowed, and rely on the OS's implementation of strtod (yes, not strtol). It seems that glibc does allow hex: C99 mandates it but C89 seems not to allow it. I think that was a mistake, and strtol should have been used. Then C89 does mandate the handling of hex constants and also octal ones. So changing to strtol would change the meaning of as.int...
2014 Jul 19
1
[PATCH] don't always call setlocale() on Windows
...VC, MinGW) version of setlocale don't care about LC_* environment variables. For example, flac cannot pass the test for --until and --skip options the script calls it with --skip=0:01.1001 and it expects decimal comma (--skip=0:01,1001) on my system. One solution is to write a local version of strtod that always accepts both decimal comma and decimal point. Another solution is not to call setlocale(LC_ALL, "") if some LC_* variable is set to "C". The patch is attached. -------------- next part -------------- A non-text attachment was scrubbed... Name: win_locale.patch Type:...
2014 Dec 06
0
GCC/clang compilation issues
...src/lib/libflac/libFLAC/stream_encoder.c:1696:43: error: cast from function call > > > of type 'double' to non-matching type 'FLAC__int32' (aka 'int') > > > [-Werror,-Wbad-function-cast] > > > ...FLAC__int32 tukey_parts = (FLAC__int32)strtod(specification+14, 0); > > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > src/lib/libflac/libFLAC/stream_encoder.c:1717:43: error: cast from function call > > > of type 'double' to non-matching type 'FLAC__int32' (aka...
2007 Jan 15
1
syslinux 3.31 will not build on RHEL3
Hi, I've attempted to build 3.31 on RHEL3 but it fails since __DBL_MIN_EXP__ and __DBL_MAX_EXP__ used in com32/lib/math/strtod.c is undefined. I added defines with the values used on RHEL4 (derived from cpp -E -dM < /dev/null) and the build then completes. A quick test did not reveal any ill effects. Is there perhaps a better workaround for this? Another little nit I saw was that com32/lib/MCONFIG has -FPNG_NO_WRITE...
2008 Jul 29
2
[LLVMdev] llvm-gcc linking errors
...used parameter 'x' main.c:291: warning: unused parameter 'y' llvm-gcc -c -g -O2 -std=c99 -Wall -Wextra -Werror-implicit-function-declaration -Wshadow -Wstrict-prototypes -pedantic-errors trirast.c llvm-gcc -g -lGL -lglut -o trirast main.o trirast.o trirast.o(.text+0x0): In function `strtod': : multiple definition of `strtod' main.o(.text+0x0): first defined here trirast.o(.text+0x10d0): In function `putchar': : multiple definition of `putchar' main.o(.text+0x1310): first defined here trirast.o(.text+0x10f0): In function `getchar': : multiple definition of `getchar...
2018 Aug 02
1
[PATCH 1/2] Add fabs() implementation
...) + fabs + ret + + .size fabs,.-fabs diff --git a/mk/lib.mk b/mk/lib.mk index 54f1fd54..d5660242 100644 --- a/mk/lib.mk +++ b/mk/lib.mk @@ -107,7 +107,7 @@ LIBOTHER_OBJS = \ pci/readb.o pci/readw.o pci/readl.o \ pci/writeb.o pci/writew.o pci/writel.o \ \ - sys/x86_init_fpu.o math/pow.o math/strtod.o \ + sys/x86_init_fpu.o math/pow.o math/fabs.o math/strtod.o \ syslinux/disk.o \ \ syslinux/setup_data.o -- 2.17.1
2003 Mar 09
0
ogg123 --end 1:59 patch.ogg
...39;}, {"delay", required_argument, 0, 'l'}, {"device-option", required_argument, 0, 'o'}, {"prebuffer", required_argument, 0, 'p'}, @@ -50,6 +51,17 @@ {0, 0, 0, 0} }; +double strtotime(char *s) +{ + double time; + + time = strtod(s, &s); + + while (*s == ':') + time = 60 * time + strtod(s + 1, &s); + + return time; +} int parse_cmdline_options (int argc, char **argv, ogg123_options_t *ogg123_opts, @@ -63,7 +75,7 @@ audio_device_t *current; int ret; - while (-1 != (ret = getopt_long(argc,...
2003 Feb 28
2
ogg123 -k 1:59 patch.ogg # minutes and seconds
Hi I have helped a user with a little patch for ogg123. He uses ogg123 for very big files, often more than an hour (blind books). When he breaks the book and later on want to go back to the same chapter, it is a little troublesome to calculate the seconds. Minutes is much more convenient as it is what is written on the screen. I guess my patch is a little buggy and would like to improve it
2005 Oct 24
2
Compilation package error
...nix/config.h... no checking for POSIXized ISC... no checking for ANSI C header files... yes checking for working const... yes checking whether time.h and sys/time.h may both be included... yes checking for 8-bit clean memcmp... yes checking for vprintf... yes checking for strstr... yes checking for strtod... yes checking for strtol... yes checking for drand48... yes checking for gettimeofday... yes checking whether byte ordering is bigendian... no checking for memory.h... yes checking for ANSI C header files... (cached) yes checking for gcc option to accept ANSI C... checking for function prototypes...
2014 Dec 07
2
GCC/clang compilation issues
.../libFLAC/stream_encoder.c:1696:43: error: cast from function call > > > > of type 'double' to non-matching type 'FLAC__int32' (aka 'int') > > > > [-Werror,-Wbad-function-cast] > > > > ...FLAC__int32 tukey_parts = (FLAC__int32)strtod(specification+14, 0); > > > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > src/lib/libflac/libFLAC/stream_encoder.c:1717:43: error: cast from function call > > > > of type 'double' to non-matching type 'FLAC__i...