Category Archives: Codes

Programming in Anime: Follow-up

Posted in Multiply on Jan 27, ’09 7:18 PM

Hello…

As the title says it, this is a follow-up to this entry I recently posted.

Let’s bring up that picture and code again:


ERRATUM: line 120 should be while s<1 or s>=2 (line now corrected)

100   /* func sample, coast creation */
110   float s
120   while s<1 or s>=2
130        input “ratio 1 to 2”; s
140   endwhile
150   s = (s-1)/10+1
160   screen 1,2,1,1
170   s=sqr(s*s-1)
180   float x0=100, x1=412, y0=0, y1=0
190   fractal(x0,x1,y0,y1,1)
200   line(100, 50, 412, 50, 255, 65535)
210   end
220   func fractal(x0;float,x1;float,y0;float,y1;float,sp;int)
230        float l, r, x2, y2
240        l=sqr[(x1-x0)*(x1-x0)+(y1-y0)*(y1-y0)]
250        if l<2 or sp>=9 then (
260               line(x0,y0/3+50,x1,y1/3+50,255,65535) ; return()
270        )
280        r=rnd()+rnd()+rnd()-2
290        x2=(x0+x1)/2+s*(y1-y0)*r
300        y2=(y0+y1)/2+s(x0+x1)*r
310        sp = sp + 1
320        fractal(x0,x2,y0,y2,sp)
330        fractal(x2,x1,y2,y1,sp)
340   endfunc

Last time, I discussed this, but only superficially. Today, we’ll delve deeper into the code.

Let us dissect the code as we go along.

The comment block at line 100 says that this is a sample coast creation function. I don’t really know what that means, but delving in through the code, we see the line

110   float s
120   while s<1 or s>2
130        input “ratio 1 to 2”; s
140   endwhile

Since the language used was BASIC, I think this is how you say that a person’s input from the keyboard be saved to a variable, in this case s. For those familiar with C, this is its equivalent (if the assumption holds):

float s=0;           /*Initial condition for the program to enter the loop*/
while (s<1 || s>2) {
printf(“ratio 1 to 2”);
scanf(“%f”, &s);
}

In Java,

BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
float s = 0;             /*Initial value of s; in Java, all declared variables should have an initial value (even objects)*/
while (s<1 || s>2) {
System.out.print(“ratio 1 to 2”);
try { s = in.readLine(); } catch (IOException e) {}    /*readline throws IOException, so this is required*/
}

The codes above assume that the program is being run in a command-line environment. If a Graphical User Interface (GUI) is desired, the Java code segment transforms into:

float s=0;
while (s<1 || s>2) {
s = (Double)JOptionPane.showInputDialog(null, “ratio 1 to 2”);
}

This brings up a pop-up window. Of course, you can design your own by making the code inherit JFrame, but then this will take longer segments of code.

In C, GUI is hard to implement, so I will pass writing a code segment.

That aside, another erratum: it is evident that the program only accepts input from the domain [1,2), excluding 2. This implies that input can range from 10000… to 1.99999…, or it will repeat asking you for a valid value until you enter

Then the following line appears:

150   s = (s-1)/10+1

Running this as a C program where s starts with 1 and ends with 1.999999, the output will range from 1.000000 to 1.1000000.

Here is the C code:

#include <stdio.h>

int main (void) {
float s=1;
while (s>=1&&s<2) {
printf (“s=%f,exp=%f\n”, s, (s-1)/10+1);
s=s+0.000001;
}
return 0;
}

Then follows this code segment:
160   screen 1,2,1,1

I really don’t know what this means. (If someone knows, let me know.)

Then,

170   s=sqr(s*s-1)

Which takes the square root of s (range 1.000000 to 1.100000 based on our C program earlier). With this, the value of s will range from 0 to 0.458258. Then follows the declarations

180   float x0=100, x1=412, y0=0, y1=0

and the functions

190   fractal(x0,x1,y0,y1,1)
200   line(100, 50, 412, 50, 255, 65535)

, then the flag indicating the end of the main function

210   end

Then follows the declaration of function fractal:

220   func fractal(x0;float,x1;float,y0;float,y1;float,sp;int)

This says that function fractal takes the following as arguments:
float arguments: x0, x1, y0, y1, sp
integer

Based on the following previous lines

180   float x0=100, x1=412, y0=0, y1=0
190   fractal(x0,x1,y0,y1,1)

The value of s is not used in this function. (It also appears to be not used at all. But then it is utilized at line 290 and 300, as we see later on.)

Then we again find the following declaration:

230        float l, r, x2, y2

Then the following:

240        l=sqr[(x1-x0)*(x1-x0)+(y1-y0)*(y1-y0)]

As we can see, this is the distance formula. Then we find the following if statement block:

250        if l<2 or sp>=9 then (
260               line(x0,y0/3+50,x1,y1/3+50,255,65535) ; return()
270        )

From the following previous lines

180   float x0=100, x1=412, y0=0, y1=0
190   fractal(x0,x1,y0,y1,1)
220   func fractal(x0;float,x1;float,y0;float,y1;float,sp;int)
240        l=sqr[(x1-x0)*(x1-x0)+(y1-y0)*(y1-y0)]

l=312. (line 180 is the initial value when the function is first called)

Then sp=1.

As we can see, line 250 is not satisfied, so control goes to the following:

280        r=rnd()+rnd()+rnd()-2

If I am not mistaken, rnd() returns a random number. Searching the rnd() function via Google, the site http://msdn.microsoft.com/en-us/library/e566zd96(VS.85).aspx states:

The Rnd function returns a value less than 1 but greater than or equal to 0. The value of number determines how Rnd generates a random number:

If number is Rnd generates
Less than zero The same number every time, using number as the seed.
Greater than zero The next random number in the sequence.
Equal to zero The most recently generated number.
Not supplied The next random number in the sequence.

For any given initial seed, the same number sequence is generated because each successive call to the Rnd function uses the previous number as a seed for the next number in the sequence.

Taking the case where rnd() returns 0.999999 (the highest possible number returned at six decimal places), the expression evaluates to:

r = 0.999999+0.999999+0.999999-2
= 0.999997

Then comes the following segment:

290        x2=(x0+x1)/2+s*(y1-y0)*r
300        y2=(y0+y1)/2+s*(x0-x1)*r

ERRATUM: lines 290 and 300 is NOT the midpoint formula, and in line 300, s*(x0-x1), not s(x0+x1). From the previous lines

180   float x0=100, x1=412, y0=0, y1=0
220   func fractal(x0;float,x1;float,y0;float,y1;float,sp;int)

and taking s as 1.100000 and s at 0.999997 (the highest possible value at 6 places we have established later on),

x2=256.000000
y2=-343.198970

Then it increments sp by 1, as evident in the following line:

310        sp = sp + 1

Then

320        fractal(x0,x2,y0,y2,sp)

This line calls recursively function fractal, which then executes the function again until the if statement block becomes true, which then calls

260               line(x0,y0/3+50,x1,y1/3+50,255,65535) ; return()

After the function returns, it then executes the following line:

330        fractal(x2,x1,y2,y1,sp)

which does again what is stated above, albeit different values in its arguments. Then the following ends the function:

340   endfunc

The program is then assumed to be terminated, since there are no other instructions that follow.

I have converted the code above into a C program:

#include <stdio.h>
#include <math.h>
#include <time.h>

void fractal (float x0, float x1, float y0, float y1, float sp, double s);
void line (float x0, float x1, float y0, float y1, int char_largest_value, int int_largest_value);

int main (void) {
double s=0;
float x0=100, x1=412, y0=0, y1=0;

while (s<1 || s>2){
printf (“\nRatio 1 to 2: “);
scanf (“%lf”, &s);
}
s=(s-1)/10+1;
s=sqrt(s*s-1);
fractal(x0,x1,y0,y1,1,s);
line(100,50,412,50,255,65535);
return 0;
}

void fractal (float x0, float x1, float y0, float y1, float sp, double s) {
float l, r, x2, y2;
l=sqrt((x1-x0)*(x1-x0)+(y1-y0)*(y1-y0));
if (l<2 || sp>=9) {
line(x0,y0/3+50,x1,y1/3+50,255,65535);
return;
}
srand(time(NULL));
r=rand()+rand()+rand()-2;
x2=(x0+x1)/2+s*(y1-y0)*r;
y2=(y0+y1)/2+s*(x0+x1)*r;
sp = sp + 1;
fractal(x0,x2,y0,y2,sp,s);
fractal(x2,x1,y2,y1,sp,s);
}

void line (float x0, float x1, float y0, float y1, int char_largest_value, int int_largest_value) {
printf (“\nx0=%f, x1=%f, y0=%f, y1=%f, char_largest_value=%d, int_largest_value=%d”, x0,x1,y0,y1,char_largest_value,int_largest_value);
}

, compiled and ran it. The code has the following characteristics:

160   screen 1,2,1,1

was omitted since it is not known what this does. Function line is assumed to just print the values of its parameters. s was added as a sixth parameter to

190   fractal(x0,x1,y0,y1,1)

since s should be passed to function fractal.

srand(time(NULL));

was added in order to make the rand() function generate more numbers more randomly.

Running the compiled code with 1 as an argument, the resulting input is:

x0=100.000000, x1=50.000000, y0=101.218750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=101.218750, x1=50.000000, y0=102.437500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=102.437500, x1=50.000000, y0=103.656250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=103.656250, x1=50.000000, y0=104.875000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=104.875000, x1=50.000000, y0=106.093750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=106.093750, x1=50.000000, y0=107.312500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=107.312500, x1=50.000000, y0=108.531250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=108.531250, x1=50.000000, y0=109.750000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=109.750000, x1=50.000000, y0=110.968750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=110.968750, x1=50.000000, y0=112.187500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=112.187500, x1=50.000000, y0=113.406250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=113.406250, x1=50.000000, y0=114.625000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=114.625000, x1=50.000000, y0=115.843750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=115.843750, x1=50.000000, y0=117.062500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=117.062500, x1=50.000000, y0=118.281250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=118.281250, x1=50.000000, y0=119.500000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=119.500000, x1=50.000000, y0=120.718750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=120.718750, x1=50.000000, y0=121.937500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=121.937500, x1=50.000000, y0=123.156250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=123.156250, x1=50.000000, y0=124.375000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=124.375000, x1=50.000000, y0=125.593750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=125.593750, x1=50.000000, y0=126.812500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=126.812500, x1=50.000000, y0=128.031250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=128.031250, x1=50.000000, y0=129.250000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=129.250000, x1=50.000000, y0=130.468750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=130.468750, x1=50.000000, y0=131.687500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=131.687500, x1=50.000000, y0=132.906250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=132.906250, x1=50.000000, y0=134.125000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=134.125000, x1=50.000000, y0=135.343750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=135.343750, x1=50.000000, y0=136.562500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=136.562500, x1=50.000000, y0=137.781250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=137.781250, x1=50.000000, y0=139.000000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=139.000000, x1=50.000000, y0=140.218750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=140.218750, x1=50.000000, y0=141.437500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=141.437500, x1=50.000000, y0=142.656250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=142.656250, x1=50.000000, y0=143.875000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=143.875000, x1=50.000000, y0=145.093750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=145.093750, x1=50.000000, y0=146.312500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=146.312500, x1=50.000000, y0=147.531250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=147.531250, x1=50.000000, y0=148.750000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=148.750000, x1=50.000000, y0=149.968750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=149.968750, x1=50.000000, y0=151.187500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=151.187500, x1=50.000000, y0=152.406250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=152.406250, x1=50.000000, y0=153.625000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=153.625000, x1=50.000000, y0=154.843750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=154.843750, x1=50.000000, y0=156.062500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=156.062500, x1=50.000000, y0=157.281250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=157.281250, x1=50.000000, y0=158.500000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=158.500000, x1=50.000000, y0=159.718750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=159.718750, x1=50.000000, y0=160.937500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=160.937500, x1=50.000000, y0=162.156250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=162.156250, x1=50.000000, y0=163.375000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=163.375000, x1=50.000000, y0=164.593750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=164.593750, x1=50.000000, y0=165.812500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=165.812500, x1=50.000000, y0=167.031250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=167.031250, x1=50.000000, y0=168.250000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=168.250000, x1=50.000000, y0=169.468750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=169.468750, x1=50.000000, y0=170.687500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=170.687500, x1=50.000000, y0=171.906250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=171.906250, x1=50.000000, y0=173.125000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=173.125000, x1=50.000000, y0=174.343750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=174.343750, x1=50.000000, y0=175.562500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=175.562500, x1=50.000000, y0=176.781250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=176.781250, x1=50.000000, y0=178.000000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=178.000000, x1=50.000000, y0=179.218750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=179.218750, x1=50.000000, y0=180.437500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=180.437500, x1=50.000000, y0=181.656250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=181.656250, x1=50.000000, y0=182.875000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=182.875000, x1=50.000000, y0=184.093750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=184.093750, x1=50.000000, y0=185.312500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=185.312500, x1=50.000000, y0=186.531250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=186.531250, x1=50.000000, y0=187.750000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=187.750000, x1=50.000000, y0=188.968750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=188.968750, x1=50.000000, y0=190.187500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=190.187500, x1=50.000000, y0=191.406250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=191.406250, x1=50.000000, y0=192.625000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=192.625000, x1=50.000000, y0=193.843750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=193.843750, x1=50.000000, y0=195.062500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=195.062500, x1=50.000000, y0=196.281250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=196.281250, x1=50.000000, y0=197.500000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=197.500000, x1=50.000000, y0=198.718750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=198.718750, x1=50.000000, y0=199.937500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=199.937500, x1=50.000000, y0=201.156250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=201.156250, x1=50.000000, y0=202.375000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=202.375000, x1=50.000000, y0=203.593750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=203.593750, x1=50.000000, y0=204.812500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=204.812500, x1=50.000000, y0=206.031250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=206.031250, x1=50.000000, y0=207.250000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=207.250000, x1=50.000000, y0=208.468750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=208.468750, x1=50.000000, y0=209.687500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=209.687500, x1=50.000000, y0=210.906250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=210.906250, x1=50.000000, y0=212.125000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=212.125000, x1=50.000000, y0=213.343750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=213.343750, x1=50.000000, y0=214.562500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=214.562500, x1=50.000000, y0=215.781250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=215.781250, x1=50.000000, y0=217.000000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=217.000000, x1=50.000000, y0=218.218750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=218.218750, x1=50.000000, y0=219.437500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=219.437500, x1=50.000000, y0=220.656250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=220.656250, x1=50.000000, y0=221.875000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=221.875000, x1=50.000000, y0=223.093750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=223.093750, x1=50.000000, y0=224.312500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=224.312500, x1=50.000000, y0=225.531250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=225.531250, x1=50.000000, y0=226.750000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=226.750000, x1=50.000000, y0=227.968750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=227.968750, x1=50.000000, y0=229.187500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=229.187500, x1=50.000000, y0=230.406250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=230.406250, x1=50.000000, y0=231.625000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=231.625000, x1=50.000000, y0=232.843750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=232.843750, x1=50.000000, y0=234.062500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=234.062500, x1=50.000000, y0=235.281250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=235.281250, x1=50.000000, y0=236.500000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=236.500000, x1=50.000000, y0=237.718750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=237.718750, x1=50.000000, y0=238.937500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=238.937500, x1=50.000000, y0=240.156250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=240.156250, x1=50.000000, y0=241.375000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=241.375000, x1=50.000000, y0=242.593750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=242.593750, x1=50.000000, y0=243.812500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=243.812500, x1=50.000000, y0=245.031250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=245.031250, x1=50.000000, y0=246.250000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=246.250000, x1=50.000000, y0=247.468750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=247.468750, x1=50.000000, y0=248.687500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=248.687500, x1=50.000000, y0=249.906250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=249.906250, x1=50.000000, y0=251.125000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=251.125000, x1=50.000000, y0=252.343750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=252.343750, x1=50.000000, y0=253.562500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=253.562500, x1=50.000000, y0=254.781250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=254.781250, x1=50.000000, y0=256.000000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=256.000000, x1=50.000000, y0=257.218750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=257.218750, x1=50.000000, y0=258.437500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=258.437500, x1=50.000000, y0=259.656250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=259.656250, x1=50.000000, y0=260.875000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=260.875000, x1=50.000000, y0=262.093750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=262.093750, x1=50.000000, y0=263.312500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=263.312500, x1=50.000000, y0=264.531250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=264.531250, x1=50.000000, y0=265.750000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=265.750000, x1=50.000000, y0=266.968750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=266.968750, x1=50.000000, y0=268.187500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=268.187500, x1=50.000000, y0=269.406250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=269.406250, x1=50.000000, y0=270.625000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=270.625000, x1=50.000000, y0=271.843750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=271.843750, x1=50.000000, y0=273.062500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=273.062500, x1=50.000000, y0=274.281250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=274.281250, x1=50.000000, y0=275.500000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=275.500000, x1=50.000000, y0=276.718750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=276.718750, x1=50.000000, y0=277.937500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=277.937500, x1=50.000000, y0=279.156250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=279.156250, x1=50.000000, y0=280.375000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=280.375000, x1=50.000000, y0=281.593750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=281.593750, x1=50.000000, y0=282.812500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=282.812500, x1=50.000000, y0=284.031250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=284.031250, x1=50.000000, y0=285.250000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=285.250000, x1=50.000000, y0=286.468750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=286.468750, x1=50.000000, y0=287.687500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=287.687500, x1=50.000000, y0=288.906250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=288.906250, x1=50.000000, y0=290.125000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=290.125000, x1=50.000000, y0=291.343750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=291.343750, x1=50.000000, y0=292.562500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=292.562500, x1=50.000000, y0=293.781250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=293.781250, x1=50.000000, y0=295.000000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=295.000000, x1=50.000000, y0=296.218750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=296.218750, x1=50.000000, y0=297.437500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=297.437500, x1=50.000000, y0=298.656250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=298.656250, x1=50.000000, y0=299.875000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=299.875000, x1=50.000000, y0=301.093750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=301.093750, x1=50.000000, y0=302.312500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=302.312500, x1=50.000000, y0=303.531250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=303.531250, x1=50.000000, y0=304.750000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=304.750000, x1=50.000000, y0=305.968750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=305.968750, x1=50.000000, y0=307.187500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=307.187500, x1=50.000000, y0=308.406250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=308.406250, x1=50.000000, y0=309.625000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=309.625000, x1=50.000000, y0=310.843750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=310.843750, x1=50.000000, y0=312.062500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=312.062500, x1=50.000000, y0=313.281250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=313.281250, x1=50.000000, y0=314.500000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=314.500000, x1=50.000000, y0=315.718750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=315.718750, x1=50.000000, y0=316.937500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=316.937500, x1=50.000000, y0=318.156250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=318.156250, x1=50.000000, y0=319.375000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=319.375000, x1=50.000000, y0=320.593750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=320.593750, x1=50.000000, y0=321.812500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=321.812500, x1=50.000000, y0=323.031250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=323.031250, x1=50.000000, y0=324.250000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=324.250000, x1=50.000000, y0=325.468750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=325.468750, x1=50.000000, y0=326.687500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=326.687500, x1=50.000000, y0=327.906250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=327.906250, x1=50.000000, y0=329.125000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=329.125000, x1=50.000000, y0=330.343750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=330.343750, x1=50.000000, y0=331.562500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=331.562500, x1=50.000000, y0=332.781250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=332.781250, x1=50.000000, y0=334.000000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=334.000000, x1=50.000000, y0=335.218750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=335.218750, x1=50.000000, y0=336.437500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=336.437500, x1=50.000000, y0=337.656250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=337.656250, x1=50.000000, y0=338.875000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=338.875000, x1=50.000000, y0=340.093750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=340.093750, x1=50.000000, y0=341.312500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=341.312500, x1=50.000000, y0=342.531250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=342.531250, x1=50.000000, y0=343.750000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=343.750000, x1=50.000000, y0=344.968750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=344.968750, x1=50.000000, y0=346.187500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=346.187500, x1=50.000000, y0=347.406250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=347.406250, x1=50.000000, y0=348.625000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=348.625000, x1=50.000000, y0=349.843750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=349.843750, x1=50.000000, y0=351.062500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=351.062500, x1=50.000000, y0=352.281250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=352.281250, x1=50.000000, y0=353.500000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=353.500000, x1=50.000000, y0=354.718750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=354.718750, x1=50.000000, y0=355.937500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=355.937500, x1=50.000000, y0=357.156250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=357.156250, x1=50.000000, y0=358.375000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=358.375000, x1=50.000000, y0=359.593750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=359.593750, x1=50.000000, y0=360.812500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=360.812500, x1=50.000000, y0=362.031250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=362.031250, x1=50.000000, y0=363.250000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=363.250000, x1=50.000000, y0=364.468750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=364.468750, x1=50.000000, y0=365.687500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=365.687500, x1=50.000000, y0=366.906250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=366.906250, x1=50.000000, y0=368.125000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=368.125000, x1=50.000000, y0=369.343750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=369.343750, x1=50.000000, y0=370.562500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=370.562500, x1=50.000000, y0=371.781250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=371.781250, x1=50.000000, y0=373.000000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=373.000000, x1=50.000000, y0=374.218750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=374.218750, x1=50.000000, y0=375.437500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=375.437500, x1=50.000000, y0=376.656250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=376.656250, x1=50.000000, y0=377.875000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=377.875000, x1=50.000000, y0=379.093750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=379.093750, x1=50.000000, y0=380.312500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=380.312500, x1=50.000000, y0=381.531250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=381.531250, x1=50.000000, y0=382.750000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=382.750000, x1=50.000000, y0=383.968750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=383.968750, x1=50.000000, y0=385.187500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=385.187500, x1=50.000000, y0=386.406250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=386.406250, x1=50.000000, y0=387.625000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=387.625000, x1=50.000000, y0=388.843750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=388.843750, x1=50.000000, y0=390.062500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=390.062500, x1=50.000000, y0=391.281250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=391.281250, x1=50.000000, y0=392.500000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=392.500000, x1=50.000000, y0=393.718750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=393.718750, x1=50.000000, y0=394.937500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=394.937500, x1=50.000000, y0=396.156250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=396.156250, x1=50.000000, y0=397.375000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=397.375000, x1=50.000000, y0=398.593750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=398.593750, x1=50.000000, y0=399.812500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=399.812500, x1=50.000000, y0=401.031250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=401.031250, x1=50.000000, y0=402.250000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=402.250000, x1=50.000000, y0=403.468750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=403.468750, x1=50.000000, y0=404.687500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=404.687500, x1=50.000000, y0=405.906250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=405.906250, x1=50.000000, y0=407.125000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=407.125000, x1=50.000000, y0=408.343750, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=408.343750, x1=50.000000, y0=409.562500, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=409.562500, x1=50.000000, y0=410.781250, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=410.781250, x1=50.000000, y0=412.000000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=100.000000, x1=50.000000, y0=412.000000, y1=50.000000, char_largest_value=255, int_largest_value=65535

With 1.999999 as an argument (the largest value at six decimal places), the following were the output:

x0=100.000000, x1=50.000000, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=nan, y1=inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=inf, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=inf, y1=341709796458605857391293497344.000000, char_largest_value=255, int_largest_value=65535
x0=inf, x1=341709796458605857391293497344.000000, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=nan, y1=inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=inf, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=816321624032245972992.000000, y1=155654289986452039720960524288.000000, char_largest_value=255, int_largest_value=65535
x0=816321624032245972992.000000, x1=155654289986452039720960524288.000000, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=nan, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=-inf, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=-inf, y1=497364058110858999894382739456.000000, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=497364058110858999894382739456.000000, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=nan, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=-inf, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=481516920490361356288.000000, y1=197833998336.000000, char_largest_value=255, int_largest_value=65535
x0=481516920490361356288.000000, x1=197833998336.000000, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=nan, y1=inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=inf, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=inf, y1=280907363487202301492548599808.000000, char_largest_value=255, int_largest_value=65535
x0=inf, x1=280907363487202301492548599808.000000, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=nan, y1=inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=inf, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=146712225744569761792.000000, y1=155654289986452039720960524288.000000, char_largest_value=255, int_largest_value=65535
x0=146712225744569761792.000000, x1=155654289986452039720960524288.000000, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=nan, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=-inf, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=-inf, y1=125253073500750261771588075520.000000, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=125253073500750261771588075520.000000, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=nan, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=-inf, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=256.000000, y1=165508202496.000000, char_largest_value=255, int_largest_value=65535
x0=256.000000, x1=165508202496.000000, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=nan, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=-inf, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=-inf, y1=-30401235375167709427953303552.000000, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-30401235375167709427953303552.000000, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=nan, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=-inf, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=146712164171918606336.000000, y1=-155654289986452039720960524288.000000, char_largest_value=255, int_largest_value=65535
x0=146712164171918606336.000000, x1=-155654289986452039720960524288.000000, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=nan, y1=inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=inf, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=inf, y1=-186055515916886783409623400448.000000, char_largest_value=255, int_largest_value=65535
x0=inf, x1=-186055515916886783409623400448.000000, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=nan, y1=inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=inf, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=-481516920490361356288.000000, y1=298690576384.000000, char_largest_value=255, int_largest_value=65535
x0=-481516920490361356288.000000, x1=298690576384.000000, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=nan, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=-inf, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=-inf, y1=-592215924570640449455888793600.000000, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-592215924570640449455888793600.000000, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=nan, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=-inf, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=-inf, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=-inf, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=-inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=-inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=-1109745987560455274496.000000, y1=-155654289986452039720960524288.000000, char_largest_value=255, int_largest_value=65535
x0=-1109745987560455274496.000000, x1=-155654289986452039720960524288.000000, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=nan, y1=inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=inf, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=inf, y1=-436561587360523581038476132352.000000, char_largest_value=255, int_largest_value=65535
x0=inf, x1=-436561587360523581038476132352.000000, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=nan, y1=inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=inf, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=inf, y1=inf, char_largest_value=255, int_largest_value=65535
x0=inf, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=inf, char_largest_value=255, int_largest_value=65535
x0=nan, x1=inf, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=nan, y1=nan, char_largest_value=255, int_largest_value=65535
x0=nan, x1=nan, y0=412.000000, y1=50.000000, char_largest_value=255, int_largest_value=65535
x0=100.000000, x1=50.000000, y0=412.000000, y1=50.000000, char_largest_value=255, int_largest_value=65535

Legend:

nan – not a number. This means the output was not a valid number, something like the square root of -1.

inf – infinity. Meaning the number is too large.

-inf – negative infinity. The number is very small.

What does these numbers really mean?

I’ll post again later. 🙂

Advertisements

Mag-iwan ng puna

Filed under Archives, Codes, Multiply

Programming in Anime, Firefox Addons

Posted in Multiply on Jan 24, ’09 8:28 PM

Hello guys…

This is the very first time I posted something out of the blue (well, maybe not the first time; it doesn’t matter anyway). It is SO boring here (I don’t have the urge to study) so whatever this post’s outcome will be, then so be it. 🙂

For starters:


This picture is from Digimon Adventure 01 (the anime I am currently watching). For those who do not know, this code is the one translated from symbols by Koushiro (Tentomon’s owner). At first glance, it is just a BASIC code (please correct me if I’m wrong) that does mathematical computations (notice the square root functions) and does further processing via the fractal function (which then calls itself recursively).

I’ll just type the code here:

100   /* func sample, coast creation */
110   float s
120   while s<1 or s>2
130        input “ratio 1 to 2”; s
140   endwhile
150   s = (s-1)/10+1
160   screen 1,2,1,1
170   s=sqr(s*s-1)
180   float x0=100, x1=412, y0=0, y1=0
190   fractal(x0,x1,y0,y1,1)
200   line(100, 50, 412, 50, 255, 65535)
210   end
220   func fractal(x0;float,x1;float,y0;float,y1;float,sp;int)
230        float l, r, x2, y2
240        l=sqr[(x1-x0)*(x1-x0)+(y1-y0)*(y1-y0)]
250        if l<2 or sp>=9 then (
260               line(x0,y0/3+50,x1,y1/3+50,255,65535) ; return()
270        )
280        r=rnd()+rnd()+rnd()-2
290        x2=(x0+x1)/2+s*(y1-y0)*r
300        y2=(y0+y1)/2+s(x0+x1)*r
310        sp = sp + 1
320        fractal(x0,x2,y0,y2,sp)
330        fractal(x2,x1,y2,y1,sp)
340   endfunc

There! Done typing! 🙂

What’s notable with this is that this code segment seem to do nothing but churn numbers (with the distance formula appearing at line 240 and the midpoint fla at lines 290 and 300), then call fractal again recursively two times (at lines 320 and 330). The program gets input at line 130 via a while loop. When input is either less than 1 or greater than 2, the program again prompts the user to enter a number (displaying the message “ratio 1 to 2”). As you can see, the valid inputs are from the interval (1,2) (1 and 2 not included).

Also, there you can see function line at 200, which was not declared in this code segment. My guess is that maybe this is a built-in function, or declared somewhere else (of course, this should be declared somewhere).

Also, this function returns when 250 is satisfied, after executing 260 (calling function line then returning afterwards). Whatever function line does, we do not know; this is the only code segment that was shown at the whole season.

What interests me so much is that this code segment made the following transformation possible:


On the left is Tentomon (holding Koushiro’s laptop) and to the right is Kabuterimon, Tentomon’s Adult form.

Cool, isn’t it? (This happened at ep 5).

Secondly, this picture:

This is what my Firefox looks like now.
This is about:blank page.

How did I do it?
Btw, this is my Linux version of Firefox.

1. Install Stylish add-on.
2. Then, go to http://www.userscripts.org and search for the following scripts:

a. Matrix – Global Style      <- makes all webpages have a black background and green text
b. about:blank – Dark Firefox  <- for displaying the blue Firefox logo at every blank tab
c. BlackMail (real black gmail Theme)
d. Firefox 3 – Chrome Theme  (Dark Gray) Tabs on Top   <- for Google Chrome styled tabs
e. Firefox 3 – Tab Tweaks
f. OneManga – Optimal Viewing
g. Yahoo! Wide BlackForest

Anyway, all of these are optional; so choose whatever you like.

I conclude this post by wishing you a happy day. 🙂

 

Multiply comments

zizo0003 wrote on Nov 19, ’10
assuming command “line” draws a line between (x0,y0) and (x1,y1) I found that this code draws a sequence of lines between the points (100,50) and (412,50) along with a straight line between these two points .
if anyone is interested mail my at zizo_0003@yahoo.com
Comment deleted at the request of the thread owner.

chong69 wrote on Jan 25, ’09

C or C++? I believe not. The line numbers already can tell us that this is not C (in BASIC, line numbers are important). Also, there are no opening/closing braces, which are prerequisites in C programs for grouping statements. Also, “input” is not a special word in C, but it is in BASIC.

Please be not offended. I don’t intend to offend anybody, I’m just saying what I know.

none taken!

we all are human, thus flawed! 😀

and its good to learn something new! 😀

thegenuisishere wrote on Jan 25, ’09
chong69 said

:))

true…

the program’s not really BASIC, but more of C or C++

but then again, who knows??? 🙂

C or C++? I believe not. The line numbers already can tell us that this is not C (in BASIC, line numbers are important). Also, there are no opening/closing braces, which are prerequisites in C programs for grouping statements. Also, “input” is not a special word in C, but it is in BASIC.

Please be not offended. I don’t intend to offend anybody, I’m just saying what I know.

chong69 wrote on Jan 24, ’09, edited on Jan 24, ’09
:))

true…

the program’s not really BASIC, but more of C or C++

but then again, who knows??? 🙂

 

Jan 24, ’09 8:28 PM

1 Puna

Filed under Archives, Codes, Multiply

Tablesorter Pager: Options

In my last post, I talked about tablesorter and tablesorter pager, and how to acquire and initialize them. Now, we will talk about the configuration options available for tablesorter pager.

Configuration

Tablesorter pager is configured by passing values in its constructor in JSON format.

$('table').tablesorter().tablesorterPager({option:"value"});

The most commonly used option in Tablesorter Pager is the container option, which defines where the Pager would be rendered. In fact, it is required to show the pager itself.

Configuration Options

The following are all the available options used by Tablesorter Pager, as written in its source code.

Option Description Default
size Defines the number of rows to display per page. 10
offset 0
page Defines the offset of the table “page” shown by default. (currentpage+page) 0
totalRows 0
totalPages 0
container Defines where the pager would be displayed. null
cssNext Defines the CSS class of the ‘next’ image. .next
cssPrev Defines the CSS class of the ‘prev’ image. .prev
cssFirst Defines the CSS class of the ‘first image. .first
cssLast Defines the CSS class of the ‘last’ image. .last
cssPageDisplay Defines the CSS class of the page display. .pagedisplay
cssPageSize Defines the CSS class of the ‘prev’ image. .pagesize
seperator Defines the separator for the current page and total number of pages. /
positionFixed Determines if position of pager is fixed or relative to the table to which it is attached. true
appender Defines the appender function for the pager. this.pager

Some notes:

  • I really don’t know what the options offset, totalRows and totalPages are for. If someone discovers their use, please post it in the comments section.
  • Notice that seperator is spelled with an ‘e’.

These are the only options Tablesorter Pager uses. In the next entries, I will post on how to apply your styles to the pager, among other things.

Mag-iwan ng puna

Filed under Codes, Javascript, Tablesorter Pager

Tablesorter Pager: Acquisition and Initialization

jQuery has a popular plugin known as Tablesorter, used to sort tabular data via JavaScript. It does its job well, and is easily (and highly) configurable, both its settings via JSON and the resulting table styles via CSS.

Tablesorter has a plugin called the Pager, designed to paginate tables via jQuery. The pager, just like the sorter, also works well, and is in itself also easily (and highly) configurable.

However, the difference between the two lie in the documentation: though Tablesorter is highly documented, the Pager’s official documentation is very scant, consisting only of an example in the Tablesorter page.

Thus, in thus series, I will try to address what the official documentation lacks: usage of the said companion plugin.

I would like first to emphasize that this series do not intend to replace the one in the official site (nor the very numerous helpful tips in StackOverflow or from other websites/blogs/forums shown by Google). Rather, my goal is to (somewhat) centralize all those knowledge out there, and (maybe) to add some of what I know. This will also serve as my notes for the said plugin.

To be honest, I really don’t know the version of Tablesorter I am using, so sorry (and feel free to correct) if anything is wrong here.

Acquisition

Tablesorter Pager is bundled with Tablesorter. You can download a copy (and read the documentation) in its official website, http://tablesorter.com/docs

According to the documentation, you need jQuery v. 1.2.1 or higher in order for the plugin to run correctly. jQuery can be downloaded from here: http://jquery.com/

After uploading the necessary files to your server, we are now ready to include the scripts in our HTML code.

NOTE: It is highly recommended to use the minified version of the scripts, for they are lesser in size. Less size => less space taken up in server => less data to transmit to users => less bandwidth consumption => faster page loads.

Initialization

To include the script in your HTML file, you can copy-paste the following codes in the head section of your HTML file:

<link rel='stylesheet' href='path/to/jqueryfile.min.js' type='text/css' />
<link rel='stylesheet' href='path/to/jquery.tablesorter.min.js' type='text/css' />
<link rel='stylesheet' href='path/to/jquery.tablesorter.pager.js' type='text/css' />

Next, attach the Tablesorter to a table:

$("table").tablesorter();

After attaching the sorter to a table, we then attach the pager to it:

$("table").tablesorterPager({container: $("pager")});

Or you may opt to do both things in one line:

$("table").tablesorter().tablesorterPager({container: $("pager")});

If you run the script at this point, you will see that the pager will not render. As is evident in the code, we have to define a place to “render” the pager itself.

You can use the following template to define your “rendering” area:

<div class="pager">
<img src="path/to/images/firstarr.png"/>
<img src="path/to/images/prevarr.png"/>
<input type="text"/>
<img src="path/to/images/nextarr.png"/>
<img src="path/to/images/lastarr.png"/>
<select>
<option value="10">10 per page</option>
<option value="25">25 per page</option>
<option value="50">50 per page</option>
</select>
</div>

Where:

  • firstarr.png: image to be clicked to get the first “page” of the table
  • prevarr.png: image to be clicked to go back a “page” of the table
  • nextarr.png: image to be clicked to go to the next “page” of the table
  • lastarr.png: image to be clicked to get the last “page” of the table
  • input field: where the “page number” of the table will be displayed
  • options: number of fields to be displayed “per page”
    Format:
    <option value=”pagesize”>Description</option>

Of course, you may insert other elements as you wish inside the div. You may even change the container type of the pager (e.g., div to form tag). However, the bulleted elements above MUST be present in order for the pager to work as expected.

Now, when you render the page, you will now see the plugin like the one demonstrated in the docs.

In the next entry, we will talk about how to configure the tablesorter plugin, and what options are available that we can manipulate to do certain interesting things.

1 Puna

Filed under Codes, Javascript, Tablesorter Pager