Shader output to Processing

without ssbos its hard work, ive tried implementing this here and have run into several issues, currently working with limitations are division substraction and addition. The limitation being the floating point precision available. only 3 decimal places and I do not know how to increase this.
Multiplication also hits a ceiling when multiplying numbers larger than 4000 together and for some reason the float component fails completely. Its the last part I have to try to figure out.

//this is due to precision errors, either the shader or PGraphics cannot handle the larger numbers, numbers between 0-500

based on the base 256 conversion in shader here is a sketch to show an example of conversion between negative and positive. Note than in github Ive simplified this enormously and instead just set a bool in the red value of shader 2 to know whether a value is negative or positive. It does limit the amount of information we can theoretically retrieve, but as the program cannot make use of any more than three decimal places the red value is uselless anyway, unless this can be rectified, then the approach in the following sketch is required.
//now updated to 4, still causes issues when multiplying large numbers, and theres an issue with rounding
Also to note the shader has no way yet to know whether a value is negative or positive, though it is as simple as modifying the writeshader program to read the red value in the shaderf shader and seeing if its set to 1.0 or 255, then adjusting accordingly I just havent got round to it, as I’m still figuring out the multiplication float component issue.

use the latest version on github the others work, if you find a read error in println() comment out the line, and v6 does not work in processing 4 as I could not revert it back to java mode.

color c;
void setup(){
  size(1200,400);
};
float mx = 120000;
int base = 256;
float r,g,b,r_,b_,g_,num;
int mm = 0;
void draw(){
  //if(mousePressed)mx+=2;
  mx = map(mouseX,-0,width,1,-1);
  mx*=1000000;
  //mx = 6553600;
  //mm = abs(int(mx));
  mm = (int(mx));
  if(mm<0)mm=6553600+abs(int(mx));
  c = (mm);
  //background(c);
  background(255);
  
  fill(0);
  color k = color(c);
  text("c: "+k,100,100);
  text("mx: "+mx,100,120);
  
  text("red: "+red(k),100,140);
  text("green: "+green(k),100,160);
  text("blue: "+blue(k),100,180);
  
  r = floor(mm/(base*base)%base);
  float r4 = floor(mm/(base*base)%100);
  float r5 = (floor(mm/(base*base)%255)-floor(mm/(base*base)%100));
  g = floor((mm/(base)%base));
  b = floor(mm)%base;
  
  //r = floor(c/(base*base)%base);
  //float r4 = floor(c/(base*base)%100);
  //float r5 = (floor(c/(base*base)%255)-floor(c/(base*base)%100))/100;
  //g = floor((c/(base)%base));
  //b = floor(c)%base;
  fill(0);
  text("r: "+r,100,220);
  text("g: "+g,100,240);
  text("b: "+b,100,260);
  
  float r1 = r/255;
  float rr1 = r4/100;
  float g1 = g/255;
  float b1 = b/255;
  
  text("r1: "+r1+","+ 4%3,100,280);
  text("g1: "+g1,100,300);
  text("b1: "+b1,100,320);
  
  
  num = r1*255*base*base+g1*255*base+b1*255;
  
  //num = rr1*99*base*base+g1*255*base+b1*255;
  
  text("num  : "+num,100,380);
  float num1 = rr1*100*base*base+g1*255*base+b1*255;
  if(floor(mm/(base*base)%255)>99)num1 = -num1;
  //if(floor(mm/(base*base)%255)>100)
  println("hello",rr1,r4,floor(mm/(base*base)%100));
  //num1 = -num1;
  text("num1  : "+num1,100,390);
  
  float r2 = r1*255;
  float g2 = g1*255;
  float b2 = b1*255;
  
  text("r2: "+r2,200,220);
  text("g2: "+g2,200,240);
  text("b2: "+b2,200,260);
  
  float r3 = r1*255;
  float g3 = g1*255;
  float b3 = b1*255;
  
  text("r3: "+r2,200,220+60);
  text("g3: "+g2,200,240+60);
  text("b3: "+b2,200,260+60);
  text("r4: "+r4,200,280+60);
  text("r5: "+r5,200,300+60);
  stroke(0);
  strokeWeight(2);
  point(width/2,100);
};

fragment shader creating for integer component of values

#ifdef GL_ES
precision highp float;
precision highp int;
#endif
#define PROCESSING_TEXTURE_SHADER
uniform float v[10];
uniform sampler2D texture;
uniform sampler2D va0;
uniform sampler2D vb0;
uniform sampler2D va1;
uniform sampler2D vb1;
uniform float mult = 1.0;
uniform float type;
uniform float thresh;
uniform vec2 texOffset;
varying vec4 vertColor;
varying vec4 vertTexCoord;
uniform vec2 resolution;
uniform float w;
uniform int [1000]s;
uniform float [10]ops;
uniform float [1000]vars;
void main(void) {
float x = 1.0 / resolution.x;
float y = 1.0 / resolution.y;
vec2 tx = vertTexCoord.st;
vec4 via0 = texture2D(va0 , vertTexCoord.st);
vec4 vib0 = texture2D(vb0 , vertTexCoord.st);
vec4 via1 = texture2D(va1 , vertTexCoord.st);
vec4 vib1 = texture2D(vb1 , vertTexCoord.st);
float base = 256;
float b1 = base*base*255;
float b2 = base*255;
float b3 = 255;
float tva0 = (via0.r*b1 + via0.g*b2 + via0.b*b3);
float tva1 = (via1.r*b1 + via1.g*b2 + via1.b*b3);
float tvb0 = (vib0.r*b1 + vib0.g*b2 + vib0.b*b3 )/100000;
float tvb1 = (vib1.r*b1 + vib1.g*b2 + vib1.b*b3 )/100000;
float tvf0 = (tvb0+tva0);
float tvf1 = (tvb1+tva1);
float num = ((tvf0)*(tvf1))*1.0;
float numf = int(num);
if(num<0.0) numf = -int(num);
float rni = floor(mod (numf/(base*base), base))/255;
float gni = floor(mod ((numf/base), base))/255;
float bni = floor(mod (numf, base))/255;
gl_FragColor = vec4(rni, gni, bni, 1.0);
}

float component generated in frag shader

#ifdef GL_ES
precision highp float;
precision highp int;
#endif
#define PROCESSING_TEXTURE_SHADER
uniform float v[10];
uniform sampler2D texture;
uniform sampler2D va0;
uniform sampler2D vb0;
uniform sampler2D va1;
uniform sampler2D vb1;
uniform float mult = 1.0;
uniform float type;
uniform float thresh;
uniform vec2 texOffset;
varying vec4 vertColor;
varying vec4 vertTexCoord;
uniform vec2 resolution;
uniform float w;
uniform int [1000]s;
uniform float [10]ops;
uniform float [1000]vars;
void main(void) {
float x = 1.0 / resolution.x;
float y = 1.0 / resolution.y;
vec2 tx = vertTexCoord.st;
vec4 via0 = texture2D(va0 , vertTexCoord.st);
vec4 vib0 = texture2D(vb0 , vertTexCoord.st);
vec4 via1 = texture2D(va1 , vertTexCoord.st);
vec4 vib1 = texture2D(vb1 , vertTexCoord.st);
float base = 256;
float b1 = base*base*255;
float b2 = base*255;
float b3 = 255;
float tva0 = (via0.r*b1 + via0.g*b2 + via0.b*b3);
float tva1 = (via1.r*b1 + via1.g*b2 + via1.b*b3);
float tvb0 = (vib0.r*b1 + vib0.g*b2 + vib0.b*b3 )/100000;
float tvb1 = (vib1.r*b1 + vib1.g*b2 + vib1.b*b3 )/100000;
float tvf0 = (tvb0+tva0);
float tvf1 = (tvb1+tva1);
float num = ((tvf0)*(tvf1))*1.0;
float numf = abs(num - int(num))*100000 ;
float rni = floor(mod (numf/(base*base), base))/255;
 rni = 0.0;
if(num<0.0)rni = 1.0;
float gni = floor(mod ((numf/base), base))/255;
float bni = floor(mod (numf, base))/255;
gl_FragColor = vec4(rni, gni, bni, 1.0);
}

in the main sketch window

PGraphics c;
float[]num, x, y;
int max = 1000;
PShader s,s1,s2,s3;
PImage imgxa,imgxb,imgya,imgyb;
PGraphics c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15;
int n = 123456789;
int m;
int z = 0;
int cwidth = 400;
int cheight = 200;
color col = color(0, 0, 0);
color cc = color(5,99,98,97);
color cc1 = color(5,99,98,97);
int[]t = new int[4];
int cmax = 255;
String []text;
String ss = "{";
String []Conv;
int []conv;
cShader cs;


void setup() {
  size(400, 400, P2D);
  text = new String[10000000];
  max = cwidth*cheight;
  surface.setLocation(1440/2-20, 0);
  x = new float[max];
  y = new float[max];
  num = new float[max];
  //initVectors();
  //numToF();
//operations to perform note that due to an error you always have to add one more operation 
//the last one is ignored.
  String op = "*-";
//this sets the size of the shader but also the maximum variables used as its based on the max 
//width of the shader so larger value will set higher integer float combination
//the second valu is the number of variables to compute
//third value can be ignored for now
  cs = new cShader(500,2,op);
  
  //cs.createshader(1,
  //String[]text = new String[10000000];
  
  //println(text);
  cs.lodRandom2();
  //smooth(8);
};

int k = 0;
float con = 0;

void draw() {
  background(255);
  //cs.runDV();//with debug info
  //cs.runDF();//with debug info
  cs.runVF();//without
  //cs.lodRandom2();//od rndom vribles
  //for(int i=0;i<cs.num.length;i+=2){
  //  point(cs.num[i],cs.num[i+1]);
  //}
  //println("frmerte",frameRate);
  strokeWeight(20);
  fill(0);
  text(frameRate, 50, 50);
};

as you can see the shader code is simple enough and there are some bits at the top that I need to remove however its not without its challenges.
va and vb are the integer component and float component of randomly generated variables stored in a PGraphics as rgb values

and initially I had tried to make use of rgba and not just rgb but the alpha channel inteferes with all the other values