Hi Khue,
On 19 July 2024 at 06:29, Khue Tran wrote: | I am currently trying to get precise inputs by taking strings instead of | numbers then writing a function to decompose the string into a rational | with the denominator in the form of 10^(-n) where n is the number of | decimal places. I am not sure if this is the only way or if there is a | better method out there that I do not know of, so if you can think of a | general way to get precise inputs from users, it will be greatly | appreciated! That is one possible way. The constraint really is that the .Call() interface we use for all [1] extensions to R only knowns SEXP types which map to a small set of known types: double, int, string, bool, ... The type used by the Boost library you are using is not among them, so you have to add code to map back and forth. Rcpp makes that easier; it is still far from automatic. R has packages such as Rmpfr interfacing GNU MPFR based on GMP. Maybe that is good enough? Also note that Rcpp has a dedicated (low volume and friendly) mailing list where questions such as this one may be better suited. Cheers, Dirk [1] A slight generalisation. There are others but they are less common / not recommended. -- dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org ______________________________________________ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel