Tag: pattern matching in scala

Prime Number Generator (6n + 1 or 6n – 1)

Prime Number Generator (6n + 1 or 6n - 1) This generator is like most where it brute forces an integer: it see whether the integer is divisible by any of the primes; if so, then it's not a prime and vice versa. This though only compares values 6n + 1 and 6n - 1 starting with n as 1 as … Continue reading Prime Number Generator (6n + 1 or 6n – 1)

Advertisements

Scala Data Type – Description

Sr.No Data Type & Description 1 Byte 8 bit signed value. Range from -128 to 127 2 Short 16 bit signed value. Range -32768 to 32767 3 Int 32 bit signed value. Range -2147483648 to 2147483647 4 Long 64 bit signed value. -9223372036854775808 to 9223372036854775807 5 Float 32 bit IEEE 754 single-precision float 6 Double … Continue reading Scala Data Type – Description