[][src]Static p5_sys::global::fract

pub static fract: FractInternalType

Calculates the fractional part of a number.

Examples

function setup() {
  createCanvas(windowWidth, windowHeight);
  fill(0);
  text(7345.73472742, 0, 50);
  text(fract(7345.73472742), 0, 100);
  text(1.4215e-15, 150, 50);
  text(fract(1.4215e-15), 150, 100);
}

Parameters

num Number whose fractional part needs to be found out