Hi everyone I have a problem about "infinite". If I type 10^308, R shows "1e+308" When I type 10^309, R shows "Inf" So, we know if a value is large than 1.XXXe+308, R will show "Inf" How can i do let the value, like "10^400" ,typed in R to show the word "1e+400" not "Inf" -- View this message in context: http://www.nabble.com/About-infinite-value-tf4128557.html#a11740491 Sent from the R help mailing list archive at Nabble.com.
arigado wrote:> Hi everyone > > I have a problem about "infinite". > If I type 10^308, R shows "1e+308" > When I type 10^309, R shows "Inf" > So, we know if a value is large than 1.XXXe+308, R will show "Inf" > How can i do let the value, like "10^400" ,typed in R to show the word > "1e+400" not "Inf" > >1. You can't, due to the computer representation of floating point numbers. 2. Package brobdingnag lets you do it anyway. -- O__ ---- Peter Dalgaard ?ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
I think that the best thing is to work in logarithmic way, to avoid the limitations of the CPU. If y = 10^400, to do y=400*log(10), to change all you formulate to the logarithmic way and the final result to apply the antilogarithm. Felipe de Mendiburu. Professor of statistic Agrarian National University -La Molina - PERU ________________________________ De: r-help-bounces at stat.math.ethz.ch en nombre de arigado Enviado el: lun 23/07/2007 4:17 Para: r-help at stat.math.ethz.ch Asunto: [R] About infinite value Hi everyone I have a problem about "infinite". If I type 10^308, R shows "1e+308" When I type 10^309, R shows "Inf" So, we know if a value is large than 1.XXXe+308, R will show "Inf" How can i do let the value, like "10^400" ,typed in R to show the word "1e+400" not "Inf" -- View this message in context: http://www.nabble.com/About-infinite-value-tf4128557.html#a11740491 Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
I think that the best thing is to work in logarithmic way, to avoid the limitations of the CPU. If y = 10^400, to do y=400*log(10), to change all you formulate to the logarithmic way and the final result to apply the antilogarithm. Felipe de Mendiburu. Professor of statistic Agrarian National University -La Molina - PERU Thank you. Thanks your method. -- View this message in context: http://www.nabble.com/About-infinite-value-tf4128557.html#a11844202 Sent from the R help mailing list archive at Nabble.com.