[Scheme entry]2 arithmetic operations

Source: Internet
Author: User
Tags square root

1, quotient, remainder, modulo and sqrt

The function is quotient used to calculate the quotient (quotient).

Functions remainder and is modulo used to find the remainder (remainder).

sqrtThe function is used to find the square root of the parameter (square root).

Here are some examples:

(quotient73)

; Value:2

(modulo73)

; Value:1
(sqrt )

; value:3.1622776601683795


2, sin, cos, tan, ASIN, ACOS and Atan

A Atan accepts 1 or 2 parameters. If atan the desired result is 1/2π, use the second parameter to indicate the use of the radian system.

The following are still some examples:

(atan1)

; Value:0.7853981633974483
(atan 1 0)

; Value:1.5707963267948966

(* 4 (Atan 1.0))

; value:3.141592653589793


3, exponent and logarithm

The exponent passes exp the function operation, the logarithm passes the log function operation. a b can be calculated by the power of the second (expt a b) .

(exp 2/3)

; value:1.9477340410546757

(EXPT 3 4)

; value:81

(log 1000)

; value:6.907755278982137


4. Transformation of several numerical values

The function exact->inexact is used to convert fractions to floating-point numbers.

(exact->inexact(/ 3 7))

; Value:1.380952380952381



[Scheme entry]2 arithmetic operations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.