1. Home
  2. /
  3. K
  4. /
  5. Prime Checker

Prime Checker - K Typing CST Test

Loading…

Prime Checker — K Code

Checks if a number is prime using modulo and all.

isPrime:{[n] n>1 & all n mod 2_til n-1}
isPrime[13]

K Language Guide

K is a high-performance, array-oriented programming language designed for financial and analytical applications. It provides concise syntax for working with large datasets, time-series data, and complex calculations, and is often used in conjunction with the kdb+ database system.

Primary Use Cases

  • ▸Financial analytics and trading systems
  • ▸Real-time market data processing
  • ▸Time-series data analysis
  • ▸High-performance data querying
  • ▸Integration with kdb+ database for analytics

Notable Features

  • ▸Array-oriented and vectorized operations
  • ▸Extremely concise and symbolic syntax
  • ▸Integration with kdb+ for database operations
  • ▸Supports functional and tacit programming styles
  • ▸Optimized for high-performance numeric and temporal calculations

Origin & Creator

Developed by Arthur Whitney in the early 1990s, as a successor to APL and influenced by the language Q.

Industrial Note

K is primarily used in the financial industry, especially for high-frequency trading, quantitative research, and time-series analysis.

More K Typing Exercises

K Counter and Theme ToggleK Fibonacci SequenceK Factorial CalculatorK Sum of ArrayK Reverse StringK Multiplication TableK Celsius to FahrenheitK Simple Alarm SimulationK Random Walk Simulation

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher