Numbers in LISP Last Updated : 09 Aug, 2022 Comments Improve Suggest changes Like Article Like Report LISP is a list processing programming language. It is widely used in the manipulation of data strings. It provides an input and output library. LISP provides a macro system and provides well control structures for the manipulation of data. LISP Math Function:floor: floor returns the nearest smallest number.ceiling: ceiling return the nearest largest number.round: rounds the argument or quotient of the arguments to the nearest integer.mod: Returns the remainder in a division operation.complex: Returns a number whose real part is real part and whose imaginary part is imaginary partAttributes Used:setq: It is used to set the value to a variable.printc: It is used for print output.terpri: It is used to produce a new line. write: It is used for writing.Example 1: Lisp ; Normal Arithmetic calculation in ; LISP(Addition, Subtraction, Multiplication, division) ;set value 1 to 190 ; set value 2 to 78 (setq val1 190) (setq val2 78) ;addition operation (princ "addition") (print (+ val1 val2)) ;subtraction operation (princ "subtraction") (print (- val1 val2)) ;multiplication operation (princ "multiplication") (print (* val1 val2)) ;division operation (princ "division") (print (/ val1 val2)) ;modulus operation (princ "modulus") (print (MOD val1 val2)) ;increment a by 10 (princ "increment by 10") (print (incf val1 val2)) ;decrement b by 20 (princ "increment by 20") (print (decf val1 val2)) Output: Example 2: Lisp ;Predefined Arithmetic data type in LISP (princ "floor: ") (write (floor 45.78)) (terpri) (princ "ceiling: ") (write (ceiling 34.34)) (terpri) (princ "round: ") (write (round 34.3)) (terpri) (princ "ffloor: ") (write (ffloor 34.43)) (terpri) (princ "fceiling: ") (write (fceiling 34.12)) (terpri) (princ "fround: ") (write (fround 34.75)) (terpri) (princ "mod: ") (write (mod 34 5)) (terpri) (princ "complex: ") (setq c (complex 6 7)) (write c) (terpri) Output: Comment More infoAdvertise with us Next Article Sequences in LISP A ayushcoding100 Follow Improve Article Tags : LISP LISP-Functions Similar Reads Symbols in LISP Symbols are lisp data objects and every type of symbol object has a name called its print name. Symbol names may contain any combination of letters and numbers, plus some special characters such as hyphens. A symbol can contain any alphabetic, numeric, or any characters except delimiter characters l 4 min read Operators in LISP Operators are the foundation of any programming language. Thus the functionality of the LISP programming language is incomplete without the use of operators. We can define operators as symbols that help us to perform specific mathematical and logical computations on operands. In other words, we can 5 min read Sequences in LISP In Lisp, the ordered set of elements is represented by sequences. All the functionality we use in sequences is applied on vectors and lists which are two of the subtypes of sequences. Creating a Sequence:The generic function for creating a Sequence in Lisp is: ;The generic function for creating a Se 7 min read Numbers in Ruby Ruby supports two types of numbers: Integers: An integer is simply a sequence of digits, e.g., 12, 100. Or in other words, numbers without decimal points are called Integers. In Ruby, Integers are object of class Fixnum(32 or 64 bits) or Bignum(used for bigger numbers).Floating-point numbers: Number 2 min read Predicates in LISP In this article, we will discuss predicates. Predicates are similar to functions that will be used to test their arguments for conditions. They will return NIL if the conditions are not met, if the conditions are met, they will return T. Types of predicates: Below is a list of major Predicates with 5 min read Perl | Number and its Types A Number in Perl is a mathematical object used to count, measure, and perform various mathematical operations. A notational symbol that represents a number is termed as a numeral. These numerals, in addition to their use in mathematical operations, are also used for ordering(in the form of serial nu 4 min read Like