The R Project SVN R

Rev

Rev 61324 | Rev 64656 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 61324 Rev 64647
Line 25... Line 25...
25
 
25
 
26
#include <Defn.h>
26
#include <Defn.h>
27
#include <float.h>  /* for DBL_MAX */
27
#include <float.h>  /* for DBL_MAX */
28
#include <Graphics.h>
28
#include <Graphics.h>
29
#include <Print.h>
29
#include <Print.h>
30
 
-
 
31
#define imax2(x, y) ((x < y) ? y : x)
30
#include <Rmath.h> // for exp10, imax2
32
 
31
 
33
/* used in graphics and grid */
32
/* used in graphics and grid */
34
SEXP CreateAtVector(double *axp, double *usr, int nint, Rboolean logflag)
33
SEXP CreateAtVector(double *axp, double *usr, int nint, Rboolean logflag)
35
{
34
{
36
/*	Create an  'at = ...' vector for  axis(.)
35
/*	Create an  'at = ...' vector for  axis(.)
Line 108... Line 107...
108
	    if (ne < 1)
107
	    if (ne < 1)
109
		error("log - axis(), 'at' creation, _LARGE_ range: "
108
		error("log - axis(), 'at' creation, _LARGE_ range: "
110
		      "ne = %d <= 0 !!\n"
109
		      "ne = %d <= 0 !!\n"
111
		      "\t axp[0:1]=(%g,%g) ==> i = %d;	nint = %d",
110
		      "\t axp[0:1]=(%g,%g) ==> i = %d;	nint = %d",
112
		      ne, axp[0],axp[1], i, nint);
111
		      ne, axp[0],axp[1], i, nint);
113
	    rng = pow(10., (double)ne);/* >= 10 */
112
	    rng = exp10((double)ne); /* >= 10 */
114
	    n = 0;
113
	    n = 0;
115
	    while (dn < umax) {
114
	    while (dn < umax) {
116
		n++;
115
		n++;
117
		dn *= rng;
116
		dn *= rng;
118
	    }
117
	    }