Jamie Balfour

Welcome to my personal website.

Find out more about me, my personal projects, reviews, courses and much more here.

Official ZPE/YASS documentationis_prime_number

Official ZPE/YASS documentationis_prime_number

is_prime_number (real value) ⇒ boolean

Checks if a number, value, is a prime number.

First available: Version 1.8.2

Notes

An example below use the is_prime_number function to calculate whether the first 100 numbers are prime or not.

YASS
for ($i = 0 to 100)
  print($i & " : " & is_prime_number($i) ? "Yes" : "No")
end for
  

The example below finds the first 100 prime numbers and uses a list to add the numbers to.

YASS
$l = []
$i = 2
while (list_get_length($l) < 100)
  $x = $i & " : " & is_prime_number($i) ? list_add_element($l, $i) : do_nothing()
  $i++
end while

print($l)
  
Comments
Feedback 👍
Comments are sent via email to me.