similar to: printing reals from C with digits -- once more

Displaying 20 results from an estimated 2000 matches similar to: "printing reals from C with digits -- once more"

2003 Jan 29
1
printing reals from C with digits
Hi, I want to print real numbers in C code with different values for digits. How to do that? As I have understood, what I should do is to call StringFromReal() which calls FormatReal(), that one suggests the parameters (width, decimal places and exponential form). FormatReal() includes eps = pow(10.0, -(double)R_print.digits); So I guess I have to change the value of R_print.digits.
1999 Oct 13
1
formatReal()-bug (or Is there anybody out there w/o IEEE754?)
On a system with IEEE_754 undefined, I run into an bug, when the value of an element of the first argument (e.g., x[0]) of formatReal() is NA: 1. (format.c:235) if (!R_FINITE ..) gives nanflag=1 (!naflag remains 0) 2. (format.c:272..288) *m gets an value of -2147483643 (from the format fiddling, should not matter to us) 3. (format.c:289) because naflag is zero, m does not
2009 May 23
2
as.numeric(levels(factor(x))) may be a decreasing sequence
Function factor() in the current development version (2009-05-22) guarantees that levels are different character strings. However, they may represent the same decimal number. The following example is derived from a posting by Stavros Macrakis in thread "Match .3 in a sequence" in March nums <- 0.3 + 2e-16 * c(-2,-1,1,2) f <- factor(nums) levels(f) # [1]
2011 Oct 28
2
[LLVMdev] [LLVM, llvm-diff] Question about FunctionDifferenceEngine and DiffConsumer::printValue
Hi all. I found next code when switch instruction differs: Engine.logf("right switch has extra case %r") << CaseValue; Where CaseValue is a ConstantInt object. Looking how logf works I found that it invokes DiffConsumer::printValue method for CaseValue. And here I found that CaseValue itself will never printed. On first look how DiffConsumer::printValue works it seems that for
2011 Oct 31
3
[LLVMdev] [LLVM, llvm-diff] Question about FunctionDifferenceEngine and DiffConsumer::printValue
Hi, Please find the attached patch for review. -Stepan. John McCall wrote: > On Oct 28, 2011, at 2:00 AM, Stepan Dyatkovskiy wrote: >> I found next code when switch instruction differs: >> >> Engine.logf("right switch has extra case %r")<< CaseValue; >> >> Where CaseValue is a ConstantInt object. Looking how logf works I found >> that it
2019 Apr 05
2
Parsing code with newlines
Hello! This is my first post here. I came across the very same problem. It can be reproduced within modified tests/Embedding/RParseEval.c Actually this example has another issue, namely it doesn't wrap everything in R_ToplevelExec . This is a major show stopper for newcomers as that function is barely mentioned anywhere and longjmp into terminated setuploop function followed by R_suicide
2011 Oct 29
0
[LLVMdev] [LLVM, llvm-diff] Question about FunctionDifferenceEngine and DiffConsumer::printValue
On Oct 28, 2011, at 2:00 AM, Stepan Dyatkovskiy wrote: > I found next code when switch instruction differs: > > Engine.logf("right switch has extra case %r") << CaseValue; > > Where CaseValue is a ConstantInt object. Looking how logf works I found > that it invokes DiffConsumer::printValue method for CaseValue. And here > I found that CaseValue itself will
2011 Nov 03
0
[LLVMdev] [LLVM, llvm-diff] Question about FunctionDifferenceEngine and DiffConsumer::printValue
ping. -Stepan. Stepan Dyatkovskiy wrote: > Hi, > > Please find the attached patch for review. > > -Stepan. > > John McCall wrote: >> On Oct 28, 2011, at 2:00 AM, Stepan Dyatkovskiy wrote: >>> I found next code when switch instruction differs: >>> >>> Engine.logf("right switch has extra case %r")<< CaseValue; >>>
2000 Jun 21
1
Port of R header files to Delphi
I'm in the process of porting R header files to Delphi. The short term aim is to be able to make calls into the R.dll from Delphi; the longer term aim is to play around with writing a Windows front-end with some of the features of the S-PLUS environment (e.g. scripts), and other features from other IDEs I've used (e.g. watch windows, popup values of variables selected by mouse, etc.)
2008 Mar 19
1
R_ParseVector problem: it's cutting off after the decimal point
Dear all, my aim is to integrate R in an interactive visualisation software called Bulk Analyzer developed by VrVis (http://www.vrvis.at). the code: SEXP e, tmp; ParseStatus status; PROTECT(tmp = mkString("x <- c(1.234,-3.45)")); PrintValue(tmp); PROTECT(e = R_ParseVector(tmp, -1, &status, R_NilValue)); PrintValue(e); UNPROTECT(2); produces the following output: [1] "x
2008 May 06
3
a R_PV problem
Dear all, When using gdb to debug my C code, I use R_PV to show the content of SEXP variables: SEXP sexp; // it is a data.frame SEXP colNames = getAttrib(sexp, R_NameSymbol); A strange thing is that after halting the program: (gdb) p R_PV(colNames) does not show the content of colNames. I am positive my code is right because if I insert "PrintValue(colNames);" in the c code,
2010 Jul 19
4
[LLVMdev] Is va_arg deprecated?
Hi folk, I'm writing a set of small C code to verify whether my pass handle some instruction correctly. One of the instruction I want to test is "va_arg", but compiling my variadic function does not generate any va_arg instruction. Is va_arg deprecated? Will va_arg instruction ever be generated by any front-end? The source code and llvm instructions are appended as follows. the
2008 Apr 29
2
Calling R from C - part way there but need a push!
Dear All, I've read the manual on "Writing R Extensions" and in particular the part on calling R from C. (Most of the manual is about calling C from R, not the other way around.) The good news is that I can now call _some_ R from C, specifically the R functions which have C header files. However it isn't clear to me how to call R functions that are written in R. I
2010 Jul 19
0
[LLVMdev] Is va_arg deprecated?
Neal, FYI, my group has added a flag to llvm-gcc for emitting the va_arg instruction (instead of lowering in the front-end), and we also have an implementation of the VAARG instruction for X86-64. (which is currently not implemented in the LLVM backend). Both of these things will be sent upstream to LLVM soon, pending some more testing and review. If you are dire need of these features now, I
2007 Apr 07
2
Rf_PrintValue problem with methods::show
Hi, I think this is a bug (even though I can't find documentation explicitly saying that it should work). Basically, Rf_PrintValue(obj) fails when 'obj' is an S4 object that should be printed using show() rather than print(). From the error message I'm guessing that the need to use show is detected correctly but then show is not found. "cbind2" in the code below is just
2015 Jun 13
2
Lack of protection bug in current R release candidate
The current R release candidate has a lack of protect bug (of very long standing) with respect to the R_print.na_string and R_print.na_string_noquote fields of the static R_print structure declared in Print.h. This shows up very occassionally as incorrect output from the following lines in reg-tests-2.R: x <- c("a", NA, "b") factor(x) factor(x, exclude="")
2003 May 02
2
Suppressing Scientific Notation
R gurus, Every so often(*) someone asks how to suppress scientific notation in printing, so I thought I'd give it a shot, but I need some help. The formatting decision is made(**) on line 286 of src/main/format.c : if (mF <= *m) { /* IFF it needs less space : "F" (Fixpoint) format */ where mF is the number of characters for "normal" printing and *m is the number
2015 Jun 15
0
Lack of protection bug in current R release candidate
>>>>> Radford Neal <radford at cs.toronto.edu> >>>>> on Sat, 13 Jun 2015 17:24:04 -0400 writes: > The current R release candidate has a lack of protect bug > (of very long standing) [ but not really reported, right ? ] > with respect to the > R_print.na_string and R_print.na_string_noquote fields of > the static
2012 Aug 18
1
[LLVMdev] GlobalVariable initializer using from beyond the grave
For LLDB I'm writing a dumb module pass that removes all global variables, by running the following code: bool erased = true; while (erased) { erased = false; for (Module::global_iterator gi = llvm_module.global_begin(), ge = llvm_module.global_end(); gi != ge; ++gi) { GlobalVariable *global_var =
2019 Apr 10
0
Parsing code with newlines
On 4/5/19 8:14 AM, Mikhail Titov wrote: > Hello! > > This is my first post here. I came across the very same problem. > It can be reproduced within modified tests/Embedding/RParseEval.c Please check https://www.r-project.org/posting-guide.html and update your post if you still need to get help here - from your current post I am not sure what you did, what was the error you got and