Skip to content

int

a whole number of any size

1
# int: a whole number, any size
2
0xff
3
# in another base
4
0b1010 + 0xff0b100001001
5
# digits grouped with underscores
6
1_000_0001000000
Example outputCtrl+Enter to run
1
# // is whole division, % the remainder
2
17 // 53
3
# ** is the power, with no overflow
4
2 ** 1001267650600228229401496703205376
5
# n! is the factorial
6
5!120
Example outputCtrl+Enter to run
  • int convert to an integer, dropping any fractional part
  • float convert to a float
  • frac show a number as a fraction, like 7/2, or as text rounded to the nearest 1/den, like “2 11/16 in”
  • exit stop the script now, with an exit code for whatever ran it
  • unicode each character’s code point in the standard U+ form, like U+00E9 for é
  • chr the character with the given Unicode code point
  • bytes a string’s UTF-8 bytes, bytes made from a list of integers 0-255, or an integer’s bytes
  • lorem the classic lorem ipsum paragraph of fake Latin that designers use as filler, or just its first n words (starting over if n is longer)
  • range the integers from 0 up to n, or from a up to b, not including the end, or with a step the numbers or quantities between
  • progress a progress bar filled to frac, from 0 (empty) to 1 (full), width characters wide
  • sqrt square root
  • abs the value without its sign, so -3 becomes 3
  • round round to the nearest whole number, or to digits decimal places
  • sig round to that many significant figures (digits counted from the first non-zero one)
  • floor round down to a whole number
  • ceil round up to a whole number
  • trunc drop the fractional part, rounding toward zero
  • sign -1 if x is negative, 0 if it’s zero, 1 if it’s positive
  • cbrt cube root
  • exp e (2.718…) to the power x
  • ln natural logarithm, the log base e
  • log logarithm base 10, or in the base given
  • nth_root the nth root of x, so nth_root(27, 3) is 3
  • log2 logarithm base 2
  • log10 logarithm base 10
  • exp2 2 to the power x
  • exp10 10 to the power x
  • hypot the length of the long side of a right triangle with sides x and y, sqrt(x² + y²)
  • sum add up a list, units included
  • avg the mean (average), or with weights, the mean where each item counts as many times as its weight
  • product multiply all the items together
  • median the middle value once sorted, or with an even count, halfway between the middle two
  • variance how spread out the numbers are
  • stdev how spread out the numbers are, in the same units as them
  • geo_mean the geometric mean: the nth root of the product, the right average for growth factors
  • harmonic_mean the harmonic mean: the reciprocal of the average reciprocal, the right average for rates
  • rms the root mean square: the square root of the average of the squares
  • mad the median absolute deviation: the median distance from the median, a spread that outliers barely move
  • sem the standard error of the mean: the standard deviation divided by the square root of the count
  • iqr the interquartile range: the 75th percentile minus the 25th
  • sin the sine of an angle, in radians or an angle unit
  • cos the cosine of an angle, in radians or an angle unit
  • tan the tangent of an angle, in radians or an angle unit
  • asin the angle whose sine is x (arcsine)
  • acos the angle whose cosine is x (arccosine)
  • atan the angle whose tangent is x (arctangent)
  • atan2 the angle from the positive x axis to the point (x, y), from -180° to 180°
  • sinh the hyperbolic sine, (eˣ - e⁻ˣ) / 2
  • cosh the hyperbolic cosine, (eˣ + e⁻ˣ) / 2
  • tanh the hyperbolic tangent, sinh(x) / cosh(x)
  • csc the cosecant of an angle, 1 / sin(x)
  • secant the secant of an angle, 1 / cos(x), not to be confused with sec for seconds
  • cot the cotangent of an angle, 1 / tan(x)
  • acsc the angle whose cosecant is x
  • asec the angle whose secant is x
  • acot the angle whose cotangent is x
  • asinh the inverse hyperbolic sine
  • acosh the inverse hyperbolic cosine, for x of 1 or more
  • atanh the inverse hyperbolic tangent, for x between -1 and 1
  • sech the hyperbolic secant, 1 / cosh(x)
  • csch the hyperbolic cosecant, 1 / sinh(x)
  • coth the hyperbolic cotangent, 1 / tanh(x)
  • sinc the normalized sinc function, sin(pi x) / (pi x), which is 1 at 0
  • gcd greatest common divisor: the largest integer that divides all of them evenly
  • lcm least common multiple: the smallest positive integer they all divide evenly
  • is_prime whether n is prime
  • factors the primes that multiply to give n, smallest first, with repeats
  • factorial n! = 1 × 2 × … × n, exact
  • double_factorial n!! = n × (n - 2) × (n - 4) × … down to 1 or 2, exact
  • hyperfactorial 1¹ × 2² × … × nⁿ, exact
  • superfactorial 1! × 2! × … × n!, exact
  • derangements how many ways n items can be shuffled so that none ends up in its original place, exact
  • choose how many ways there are to pick k things from n when order doesn’t matter (the binomial coefficient), exact
  • permutations how many ways there are to pick k things from n when order matters, exact
  • perm the same as permutations
  • mod_pow the remainder of b to the power e, divided by m, worked out without ever computing the huge power
  • mod_inv the number b from 0 to m - 1 for which a × b leaves remainder 1 when divided by m
  • rem the remainder of a divided by b, with the same sign as a, as C’s and JavaScript’s % give it
  • fib the nth Fibonacci number, exact
  • next_prime the smallest prime greater than n
  • prev_prime the largest prime less than n
  • divisors every positive divisor of n, smallest first
  • primes the primes up to n, or from a up to b
  • prime_count how many primes are at most n
  • nth_prime the nth prime, so nth_prime(1) is 2
  • digit_sum the sum of n’s digits, in a base (default 10)
  • digital_root add n’s digits again and again until one digit is left, in a base (default 10)
  • bernoulli the Bernoulli number B(n) as an exact fraction, with B(1) = -1/2 and 0 for odd n above 1
  • numerator the numerator of a fraction in lowest terms, or of a whole number itself
  • denominator the denominator of a fraction in lowest terms, or 1 for a whole number
  • frac_part the part of x after the point, keeping its sign: frac_part(-2.25) is -0.25
  • is_even whether n is even
  • is_odd whether n is odd
  • totient Euler’s totient φ(n)
  • egcd the extended gcd of a and b: [g, x, y] with a × x + b × y = g, their gcd
  • iroot the integer k-th root of x, rounded toward zero, and whether it’s exact, as [root, exact]
  • jacobi the Jacobi symbol (a/n) for an odd positive n: 0, 1 or -1
  • legendre the Legendre symbol (a/p) for an odd prime p: 1 if a is a nonzero square mod p, -1 if it isn’t, 0 if p divides a
  • sqrt_mod every x from 0 to p - 1 with x × x leaving remainder a when divided by the prime p, smallest first
  • discrete_log the smallest x from 0 up with g ** x leaving remainder h when divided by the prime p, the discrete logarithm
  • rsa_d the private exponent d of textbook RSA, from the primes p and q and the public exponent e
  • rsa_encrypt textbook RSA encryption, m ** e mod n, with no padding
  • rsa_decrypt textbook RSA decryption, c ** d mod n, as an integer
  • isqrt the integer part of the square root of n, exact at any size
  • cfrac x as a continued fraction, the list [a0, a1, a2, …] meaning a0 + 1/(a1 + 1/(a2 + …))
  • popcount how many bits are 1
  • bit bit i of n, as 0 or 1, where bit 0 is the lowest
  • set_bit n with bit i turned on (set to 1)
  • clear_bit n with bit i turned off (set to 0)
  • rotl treat n as a width-bit number and rotate it left by k
  • rotr treat n as a width-bit number and rotate it right by k
  • byteswap reverse the order of the bytes in a width-bit number, converting between little- and big-endian
  • to_fixed x as a fixed-point integer with int_bits whole bits and frac_bits fractional ones, rounded, shown in hex
  • from_fixed the number a fixed-point integer with int_bits whole bits and frac_bits fractional ones stands for
  • bcd a non-negative integer in binary-coded decimal, where each decimal digit takes one hex digit, so 1234 is 0x1234
  • from_bcd the number a binary-coded decimal integer stands for, the reverse of bcd
  • float_bits the bit pattern of x in a float format, shown in hex
  • from_float_bits the float with the given bit pattern, the reverse of float_bits
  • float_parts the sign, exponent and mantissa fields of x as stored, as a map
  • nearest_float x rounded to the nearest number a float format can store
  • float_error how far x is from the nearest number a float format can store, as nearest minus x
  • normal_pdf the probability density of a normal distribution at x, how likely values near x are
  • normal_cdf the chance that a normal variable is at most x
  • normal_inv the value that a normal variable falls below with chance p, the reverse of normal_cdf
  • t_pdf the probability density of a Student’s t distribution at x, how likely values near x are
  • t_cdf the chance that a Student’s t variable is at most x
  • t_inv the value that a Student’s t variable falls below with chance p, the reverse of t_cdf
  • chi2_pdf the probability density of a chi-squared distribution at x, how likely values near x are
  • chi2_cdf the chance that a chi-squared variable is at most x
  • chi2_inv the value that a chi-squared variable falls below with chance p, the reverse of chi2_cdf
  • f_pdf the probability density of an F distribution at x, how likely values near x are
  • f_cdf the chance that an F variable is at most x
  • f_inv the value that an F variable falls below with chance p, the reverse of f_cdf
  • exp_pdf the probability density of an exponential distribution at x, how likely values near x are
  • exp_cdf the chance that an exponential variable is at most x
  • exp_inv the value that an exponential variable falls below with chance p, the reverse of exp_cdf
  • gamma_pdf the probability density of a gamma distribution at x, how likely values near x are
  • gamma_cdf the chance that a gamma variable is at most x
  • gamma_inv the value that a gamma variable falls below with chance p, the reverse of gamma_cdf
  • beta_pdf the probability density of a beta distribution at x, how likely values near x are
  • beta_cdf the chance that a beta variable is at most x
  • beta_inv the value that a beta variable falls below with chance p, the reverse of beta_cdf
  • weibull_pdf the probability density of a Weibull distribution at x, how likely values near x are
  • weibull_cdf the chance that a Weibull variable is at most x
  • weibull_inv the value that a Weibull variable falls below with chance p, the reverse of weibull_cdf
  • cauchy_pdf the probability density of a Cauchy distribution at x, how likely values near x are
  • cauchy_cdf the chance that a Cauchy variable is at most x
  • cauchy_inv the value that a Cauchy variable falls below with chance p, the reverse of cauchy_cdf
  • logistic_pdf the probability density of a logistic distribution at x, how likely values near x are
  • logistic_cdf the chance that a logistic variable is at most x
  • logistic_inv the value that a logistic variable falls below with chance p, the reverse of logistic_cdf
  • pareto_pdf the probability density of a Pareto distribution at x, how likely values near x are
  • pareto_cdf the chance that a Pareto variable is at most x
  • pareto_inv the value that a Pareto variable falls below with chance p, the reverse of pareto_cdf
  • rayleigh_pdf the probability density of a Rayleigh distribution at x, how likely values near x are
  • rayleigh_cdf the chance that a Rayleigh variable is at most x
  • rayleigh_inv the value that a Rayleigh variable falls below with chance p, the reverse of rayleigh_cdf
  • binom_pmf the chance of exactly k successes in n tries that each succeed with chance p
  • binom_cdf the chance of at most k successes in n tries that each succeed with chance p
  • binom_inv the fewest successes in n tries with chance p each that are at least as likely as q to be reached, the reverse of binom_cdf
  • poisson_pmf the chance of exactly k events when rate of them are expected on average
  • poisson_cdf the chance of at most k events when rate of them are expected on average
  • poisson_inv the fewest events that are at least as likely as q to be reached when rate are expected, the reverse of poisson_cdf
  • rand_normal a random number from a normal distribution with that mean and sd, or a list of n of them
  • rand_exp a random wait from an exponential distribution with that rate, or a list of n of them
  • rand_poisson a random event count from a Poisson distribution with that rate, or a list of n of them
  • hex an integer in hex, the same as v to hex
  • bin an integer in binary, the same as v to bin
  • oct an integer in octal, the same as v to oct
  • dec an integer in decimal, the same as v to dec
  • base an integer in any base from 2 to 62, the same as v to base(b)
  • to_base an integer as text in a base from 2 to 62, or in your own digits: to_base(10, "ab") is “baba”
  • base_table a one-row table of an integer in binary, octal, decimal and hex
  • column_name the spreadsheet column letters for column n, counting from 1
  • digits the list of a number’s digits, in the base it was written in
  • fixed x as text with exactly that many decimals, padding with zeros if needed
  • sci x as text in scientific notation, like 1.23e5 for 123000, with digits decimals
  • eng x as text in engineering notation, with the exponent a multiple of 3, like 123.457e6, with digits decimals
  • mixed_frac a number as a mixed fraction text, like “1 1/4” for 1.25, optionally rounded to the nearest 1/den
  • percent a fraction as percentage text, so 0.256 is “25.6%”, with digits decimals
  • commas x as text with commas between thousands, like “1,234,567”, with digits decimals
  • spell an integer in English words, like “forty-two”
  • short_scale a number as compact text with a short-scale word, like “2.5 million”
  • ordinal the number with its English ordinal ending: 1st, 2nd, 3rd, 4th, 11th, 21st and so on
  • human_bytes a number of bytes as text in the largest binary unit that fits, like “117.7 MiB”, with one decimal
  • dms an angle as degrees, arcminutes and arcseconds text, like 52°20′24″
  • lat a latitude in degrees as text with N or S, like 7°19′48″S
  • lon a longitude in degrees as text with E or W, like 74°0′21″W
  • roman a positive integer as a Roman numeral, or a numeral back to an integer
  • rand a random decimal from 0 up to but not including 1
  • seed make the session’s random choices repeatable
  • birthday_paradox the chance that at least two of n people share a birthday
  • odds a probability as “1 in N”, with a familiar event that’s about as likely, to give a feel for it
  • coin “heads” or “tails”, or a list of n flips
  • re the real part
  • im the imaginary part, as a plain number
  • conj the complex conjugate: the same number with its imaginary part negated
  • arg the angle from the positive real axis to the number, as an angle unit
  • csqrt square root that gives a complex number for negatives, so csqrt(-4) is 2i
  • croots all n complex nth roots of a number, as a list
  • polar make a complex number from its polar form, or with one argument show z in that form
  • identity the n by n identity matrix: 1 down the diagonal and 0 elsewhere
  • matrix a matrix of the given number of rows and columns, filled with fill (0 if left out)
  • gamma the gamma function, which extends the factorial: gamma(n + 1) is n!, and it works between whole numbers too
  • lgamma the natural log of the gamma function, which stays finite where gamma itself is too large
  • beta the beta function, gamma(a) × gamma(b) / gamma(a + b)
  • erf the error function: the chance a normal variable lands within x√2 standard deviations of its mean
  • erfc the complementary error function, 1 - erf(x), accurate even where that would round to 0
  • digamma the digamma function, the slope of lgamma: the derivative of ln(gamma(x))
  • zeta the Riemann zeta function, the sum of 1 / n^s over every whole number n from 1
  • erf_inv the inverse of the error function: the x where erf(x) is y, for y between -1 and 1
  • probit the normal quantile: the z where a standard normal variable falls below z with chance p
  • gamma_inc the regularized lower incomplete gamma function: the share of gamma(a) accumulated up to x, from 0 to 1
  • beta_inc the regularized incomplete beta function: the share of beta(a, b) accumulated up to x, for x from 0 to 1
  • sigmoid the logistic curve 1 / (1 + e^-x): an S shape from 0 to 1
  • logit the inverse of sigmoid, ln(p / (1 - p)), for p between 0 and 1
  • heaviside the step function: 0 below zero, 1 above, and 1/2 at zero
  • ramp the ramp function: 0 below zero, and x above
  • rect the rectangle pulse: 1 for x within 1/2 of zero, 1/2 at the edges, 0 beyond
  • tri the triangle pulse: 1 at zero, falling in straight lines to 0 at 1 and -1
  • db a ratio of two powers in decibels, as 10 × log10(ratio), so doubling is about +3 dB
  • from_db decibels back to the ratio of powers, the reverse of db
  • grow what money will be worth after time at the rate
  • present_value what a future sum, and any regular payments up to then, are worth today at the rate
  • npv the net present value of a list of cash flows: each is discounted by the rate for every period since the first, which is now
  • loan_rate the yearly rate of a loan from its monthly payment (the annual percentage rate, compounding monthly)
  • depreciation a schedule of how an asset loses value over its life, a row per year
  • cagr the steady yearly growth rate that would take start to end over time (compound annual growth rate)
  • real_rate what a return is really worth once inflation is taken out
  • payment the monthly payment that pays off a loan over time, interest included
  • payoff how long a regular payment takes to pay off a balance with interest, rounded up to whole payments
  • amortize a loan’s month-by-month schedule
  • share split a sum into parts, in equal shares or by the weights in a list, rounded to the cent so they still add up exactly
  • change how much a value changed, as a fraction of where it started
  • margin profit as a fraction of the selling price
  • markup profit as a fraction of what it cost you
  • date a date from text: ISO (2026-12-25), US (12/25/2026), written out (Dec 25 2026) or plain English (next friday at 5pm, 3 days ago)
  • date_ms the date for a Unix timestamp in milliseconds, the form JavaScript and Java use
  • leap_year whether the year is a leap year
  • holidays a year’s public holidays, on the day they’re taken off when they fall on a weekend
  • calendar a month drawn as a calendar grid, weeks starting on Monday
  • chinese_zodiac the Chinese zodiac element and animal for a year
  • sunrise when the sun rises at a place on a day, or nil if it doesn’t rise or doesn’t set that day
  • sunset when the sun sets at a place on a day, or nil if it doesn’t rise or doesn’t set that day
  • day_length how long the sun is up at a place on a day: 0 h if it never rises, 24 h if it never sets
  • nearest the city closest to a latitude and longitude, out of those zil knows
  • chmod convert Unix file permissions between the number form, like 755, and the letters ls -l shows, like “rwxr-xr-x”
  • ip an IPv4 or IPv6 address as a plain integer, or an integer back as an address
  • port the service that normally listens on a port number, like “ssh” for 22, or the port for a service name, or nil if unknown
  • password a random password of letters, digits and symbols
  • passphrase random words joined by dashes, easier to type and remember than a password, each adding about 9.4 bits of strength
  • nanoid a random ID made only of characters that are safe in URLs, about as unlikely to repeat as a UUID
  • rgb make a color from red, green and blue amounts (0-255), or give one argument to get a color’s three amounts
  • hsl make a color from hue, saturation and lightness, or give one argument to get a color’s three values
  • luhn whether a number passes the Luhn check, the check digit on credit cards and phone IMEIs
  • http_status the standard name for an HTTP status code, like “Not Found” for 404, or nil if it isn’t one
  • p8 x as 1 byte, with -128 to -1 come out in two’s complement
  • p16 x as 2 bytes, lowest byte first, or highest first if order is “big”
  • p32 x as 4 bytes, lowest byte first, or highest first if order is “big”
  • p64 x as 8 bytes, lowest byte first, or highest first if order is “big”
  • cyclic n bytes of a pattern in which every run of 4 bytes is different (a de Bruijn sequence), to send to a program with a buffer overflow and see which part ends up where
  • cyclic_find how many bytes into the cyclic pattern sub appears, or nil
  • awg the diameter of American Wire Gauge number gauge, in mm
  • raid the usable capacity of n disks of size disk in a RAID array of the given level
  • ram_latency the true latency of memory in ns, from its transfer rate in MT/s and CAS latency cl
  • segments big digits like a digital clock’s, for 0-9, A-F, -, ., : and spaces
  • rule run a cellular automaton
  • spiral an Ulam spiral: the numbers 1, 2, 3, … wound outward from the center, with a dot for each prime
  • starfield a random night sky
  • mandelbrot the Mandelbrot set, the famous fractal, drawn in ASCII characters
  • maze a random maze with exactly one path between any two points
  • dice draw a die showing 1 to 6, or several side by side for a list

Example results generated on 2026-11-04. Ones using now, today or randomness will differ when you run them.