mirror of
https://github.com/enso-org/enso.git
synced 2024-12-23 18:15:21 +03:00
93fee3a51f
Here we go again... - Tidied up `Pair` and stopped exporting `Pair_Data`. Adjusted so type exported. - Tidy imports for `Json`, `Json.Internal`, `Locale`. - Tidy imports Ordering.*. Export `Sort_Direction` and `Case_Sensitivity` as types. - Move methods of `Statistics` into `Statistic`. Publishing the types not the module. - Added a `compute` to a `Rank_Method`. - Tidied the `Regression` module. - Move methods of `Date`, `Date_Time`, `Duration`, `Time_Of_Day` and `Time_Zone` into type. Publishing types not modules. - Added exporting `Period`, `Date_Period` and `Time_Period` as types. Static methods moved into types. # Important Notes - Move `compare_to_ignore_case`, `equals_ignore_case` and `to_case_insensitive_key` from Extensions into `Text`. - Hiding polyglot java imports from export all in `Main.enso`.
66 lines
1.5 KiB
Plaintext
66 lines
1.5 KiB
Plaintext
import project.Data.Numbers.Decimal
|
|
import project.Data.Numbers.Number
|
|
|
|
## Alias Pi (Constant)
|
|
|
|
The mathematical constant pi, equal to the ratio of a circle circumference
|
|
to its diameter.
|
|
|
|
> Example
|
|
Calculating the area of a circle.
|
|
|
|
circle_area r = 2 * Math.pi * r^2
|
|
pi : Decimal
|
|
pi = 3.1415926535897932385
|
|
|
|
## ALIAS e (Constant)
|
|
|
|
The mathematical constant e, the base of the natural logarithm.
|
|
|
|
> Example
|
|
Calculating the natural logarithm of 3.
|
|
|
|
3.log Math.e
|
|
e : Decimal
|
|
e = 2.718281828459045235360
|
|
|
|
## ALIAS Minimum
|
|
|
|
Returns the smaller value of `a` and `b`.
|
|
|
|
Arguments:
|
|
- a: The first number.
|
|
- b: The second number.
|
|
|
|
? Math.min or Number.min
|
|
While we provide the min method on `Number`, we find it more intuitive to
|
|
write `Math.min a b` rather than `a.min b`. To that end, we recommend using
|
|
the first style.
|
|
|
|
> Example
|
|
Calculate the smallest number out of 1 and 2.
|
|
|
|
Math.min 1 2
|
|
min : Number -> Number -> Number
|
|
min a b = if a <= b then a else b
|
|
|
|
## ALIAS Maximum
|
|
|
|
Returns the larger value of `a` and `b`.
|
|
|
|
Arguments:
|
|
- a: The first number.
|
|
- b: The second number.
|
|
|
|
? Math.max or Number.max
|
|
While we provide the max method on `Number`, we find it more intuitive to
|
|
write `Math.max a b` rather than `a.max b`. To that end, we recommend using
|
|
the first style.
|
|
|
|
> Example
|
|
Calculate the largest number out of 1 and 2.
|
|
|
|
Math.max 1 2
|
|
max : Number -> Number -> Number
|
|
max a b = if a < b then b else a
|