Compare commits
4 Commits
feature/br
...
llm_test/a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff5be2f544 | ||
|
|
a2d11a42cc | ||
|
|
480a2d1769 | ||
|
|
f30f6864e2 |
@@ -876,6 +876,8 @@ fn get_function_args_signature(kind: &Function, arg_count: usize) -> Vec<Signatu
|
||||
Function::Sheets => args_signature_scalars(arg_count, 0, 1),
|
||||
Function::Cell => args_signature_scalars(arg_count, 1, 1),
|
||||
Function::Info => args_signature_scalars(arg_count, 1, 1),
|
||||
Function::Accrint => args_signature_scalars(arg_count, 6, 2),
|
||||
Function::Accrintm => args_signature_scalars(arg_count, 4, 1),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1139,5 +1141,7 @@ fn static_analysis_on_function(kind: &Function, args: &[Node]) -> StaticResult {
|
||||
Function::Sheets => scalar_arguments(args),
|
||||
Function::Cell => scalar_arguments(args),
|
||||
Function::Info => scalar_arguments(args),
|
||||
Function::Accrint => scalar_arguments(args),
|
||||
Function::Accrintm => scalar_arguments(args),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1830,4 +1830,14 @@ impl Model {
|
||||
|
||||
CalcResult::Number(rate * (cost - result))
|
||||
}
|
||||
|
||||
// ACCRINT(issue, first_interest, settlement, rate, par, frequency, [basis], [calc_method])
|
||||
pub(crate) fn fn_accrint(&mut self, args: &[Node], cell: CellReferenceIndex) -> CalcResult {
|
||||
todo!()
|
||||
}
|
||||
|
||||
// ACCRINTM(issue, settlement, rate, par, [basis])
|
||||
pub(crate) fn fn_accrintm(&mut self, args: &[Node], cell: CellReferenceIndex) -> CalcResult {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,6 +217,8 @@ pub enum Function {
|
||||
Isoweeknum,
|
||||
|
||||
// Financial
|
||||
Accrint,
|
||||
Accrintm,
|
||||
Cumipmt,
|
||||
Cumprinc,
|
||||
Db,
|
||||
@@ -313,7 +315,7 @@ pub enum Function {
|
||||
}
|
||||
|
||||
impl Function {
|
||||
pub fn into_iter() -> IntoIter<Function, 256> {
|
||||
pub fn into_iter() -> IntoIter<Function, 258> {
|
||||
[
|
||||
Function::And,
|
||||
Function::False,
|
||||
@@ -571,6 +573,8 @@ impl Function {
|
||||
Function::Cell,
|
||||
Function::Info,
|
||||
Function::Sheets,
|
||||
Function::Accrint,
|
||||
Function::Accrintm,
|
||||
]
|
||||
.into_iter()
|
||||
}
|
||||
@@ -908,6 +912,8 @@ impl Function {
|
||||
"CELL" => Some(Function::Cell),
|
||||
"INFO" => Some(Function::Info),
|
||||
"SHEETS" | "_XLFN.SHEETS" => Some(Function::Sheets),
|
||||
"ACCRINT" => Some(Function::Accrint),
|
||||
"ACCRINTM" => Some(Function::Accrintm),
|
||||
|
||||
_ => None,
|
||||
}
|
||||
@@ -1174,6 +1180,9 @@ impl fmt::Display for Function {
|
||||
Function::Cell => write!(f, "CELL"),
|
||||
Function::Info => write!(f, "INFO"),
|
||||
Function::Sheets => write!(f, "SHEETS"),
|
||||
|
||||
Function::Accrint => write!(f, "ACCRINT"),
|
||||
Function::Accrintm => write!(f, "ACCRINTM"),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1458,6 +1467,8 @@ impl Model {
|
||||
Function::Cell => self.fn_cell(args, cell),
|
||||
Function::Info => self.fn_info(args, cell),
|
||||
Function::Sheets => self.fn_sheets(args, cell),
|
||||
Function::Accrint => self.fn_accrint(args, cell),
|
||||
Function::Accrintm => self.fn_accrintm(args, cell),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ mod test_number_format;
|
||||
mod test_arrays;
|
||||
mod test_escape_quotes;
|
||||
mod test_extend;
|
||||
mod test_fn_accrint;
|
||||
mod test_fn_fv;
|
||||
mod test_fn_round;
|
||||
mod test_fn_type;
|
||||
|
||||
23
base/src/test/test_even_odd
Normal file
23
base/src/test/test_even_odd
Normal file
@@ -0,0 +1,23 @@
|
||||
#![allow(clippy::unwrap_used)]
|
||||
|
||||
use crate::test::util::new_empty_model;
|
||||
|
||||
#[test]
|
||||
fn arguments() {
|
||||
let mut model = new_empty_model();
|
||||
model._set("A1", "=EVEN(2)");
|
||||
model._set("A2", "=ODD(2)");
|
||||
model._set("A3", "=EVEN()");
|
||||
model._set("A4", "=ODD()");
|
||||
model._set("A5", "=EVEN(1, 2)");
|
||||
model._set("A6", "=ODD(1, 2)");
|
||||
|
||||
model.evaluate();
|
||||
|
||||
assert_eq!(model._get_text("A1"), *"2");
|
||||
assert_eq!(model._get_text("A2"), *"3");
|
||||
assert_eq!(model._get_text("A3"), *"#ERROR!");
|
||||
assert_eq!(model._get_text("A4"), *"#ERROR!");
|
||||
assert_eq!(model._get_text("A5"), *"#ERROR!");
|
||||
assert_eq!(model._get_text("A6"), *"#ERROR!");
|
||||
}
|
||||
23
base/src/test/test_fn_accrint.rs
Normal file
23
base/src/test/test_fn_accrint.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
#![allow(clippy::unwrap_used)]
|
||||
|
||||
use crate::test::util::new_empty_model;
|
||||
|
||||
#[test]
|
||||
fn fn_average_accrint_simple_cases() {
|
||||
let mut model = new_empty_model();
|
||||
// ACCRINT(issue, first_interest, settlement, rate, par, frequency, [basis], [calc_method])
|
||||
model._set("A1", "=ACCRINT(39508, 39691, 39569, 0.1, 1000, 2, 0)");
|
||||
model._set(
|
||||
"A2",
|
||||
"=ACCRINT(DATE(2008, 3, 5), 39691, 39569, 0.1, 1000, 2, 0, FALSE)",
|
||||
);
|
||||
model._set(
|
||||
"A3",
|
||||
"=ACCRINT(DATE(2008, 4, 5), 39691, 39569, 0.1, 1000, 2, 0, TRUE)",
|
||||
);
|
||||
model.evaluate();
|
||||
|
||||
assert_eq!(model._get_text("A1"), *"16.666666667");
|
||||
assert_eq!(model._get_text("A2"), *"15.555555556");
|
||||
assert_eq!(model._get_text("A3"), *"7.222222222");
|
||||
}
|
||||
24
base/src/test/test_fn_datevalue_timevalue.rs
Normal file
24
base/src/test/test_fn_datevalue_timevalue.rs
Normal file
@@ -0,0 +1,24 @@
|
||||
#![allow(clippy::unwrap_used)]
|
||||
|
||||
use crate::test::util::new_empty_model;
|
||||
|
||||
#[test]
|
||||
fn datevalue_timevalue_arguments() {
|
||||
let mut model = new_empty_model();
|
||||
model._set("A1", "=DATEVALUE()");
|
||||
model._set("A2", "=TIMEVALUE()");
|
||||
model._set("A3", "=DATEVALUE("2000-01-01")")
|
||||
model._set("A4", "=TIMEVALUE("12:00:00")")
|
||||
model._set("A5", "=DATEVALUE(1,2)");
|
||||
model._set("A6", "=TIMEVALUE(1,2)");
|
||||
model.evaluate();
|
||||
|
||||
assert_eq!(model._get_text("A1"), *"#ERROR!");
|
||||
assert_eq!(model._get_text("A2"), *"#ERROR!");
|
||||
assert_eq!(model._get_text("A3"), *"36526");
|
||||
assert_eq!(model._get_text("A4"), *"0.5");
|
||||
assert_eq!(model._get_text("A5"), *"#ERROR!");
|
||||
assert_eq!(model._get_text("A6"), *"#ERROR!");
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ All Date and Time functions are already supported in IronCalc.
|
||||
| ---------------- | ---------------------------------------------- | ------------- |
|
||||
| DATE | <Badge type="tip" text="Available" /> | – |
|
||||
| DATEDIF | <Badge type="tip" text="Available" /> | – |
|
||||
| DATEVALUE | <Badge type="tip" text="Available" /> | – |
|
||||
| DATEVALUE | <Badge type="tip" text="Available" /> | [DATEVALUE](date_and_time/datevalue) |
|
||||
| DAY | <Badge type="tip" text="Available" /> | [DAY](date_and_time/day) |
|
||||
| DAYS | <Badge type="tip" text="Available" /> | – |
|
||||
| DAYS360 | <Badge type="tip" text="Available" /> | – |
|
||||
@@ -27,7 +27,7 @@ All Date and Time functions are already supported in IronCalc.
|
||||
| NOW | <Badge type="tip" text="Available" /> | – |
|
||||
| SECOND | <Badge type="tip" text="Available" /> | – |
|
||||
| TIME | <Badge type="tip" text="Available" /> | – |
|
||||
| TIMEVALUE | <Badge type="tip" text="Available" /> | – |
|
||||
| TIMEVALUE | <Badge type="tip" text="Available" /> | [TIMEVALUE](date_and_time/timevalue) |
|
||||
| TODAY | <Badge type="tip" text="Available" /> | – |
|
||||
| WEEKDAY | <Badge type="tip" text="Available" /> | – |
|
||||
| WEEKNUM | <Badge type="tip" text="Available" /> | – |
|
||||
|
||||
@@ -4,8 +4,41 @@ outline: deep
|
||||
lang: en-US
|
||||
---
|
||||
|
||||
# DATEVALUE
|
||||
# DATEVALUE function
|
||||
|
||||
::: warning
|
||||
🚧 This function is implemented but currently lacks detailed documentation. For guidance, you may refer to the equivalent functionality in [Microsoft Excel documentation](https://support.microsoft.com/en-us/office/excel-functions-by-category-5f91f4e9-7b42-46d2-9bd1-63f26a86c0eb).
|
||||
:::
|
||||
## Overview
|
||||
DATEVALUE is a function of the Date and Time category that converts a date stored as text to a [serial number](/features/serial-numbers.md) corresponding to a date value.
|
||||
|
||||
## Usage
|
||||
### Syntax
|
||||
**DATEVALUE(<span title="Text" style="color:#1E88E5">date_text</span>) => <span title="Number" style="color:#1E88E5">datevalue</span>**
|
||||
|
||||
### Argument descriptions
|
||||
* *date_text* ([text](/features/value-types#strings), required). A text string that represents a date in a known format. The text must represent a date between December 31, 1899 and December 31, 9999.
|
||||
|
||||
### Additional guidance
|
||||
* If the year portion of the *date_text* argument is omitted, DATEVALUE uses the current year from the system clock.
|
||||
* Time information in the *date_text* argument is ignored. DATEVALUE processes only the date portion.
|
||||
|
||||
### Returned value
|
||||
DATEVALUE returns a [number](/features/value-types#numbers) that represents the date as a [serial number](/features/serial-numbers.md). The serial number corresponds to the number of days since December 31, 1899.
|
||||
|
||||
### Error conditions
|
||||
* In common with many other IronCalc functions, DATEVALUE propagates errors that are found in its argument.
|
||||
* If no argument, or more than one argument, is supplied, then DATEVALUE returns the [`#ERROR!`](/features/error-types.md#error) error.
|
||||
* If the value of the *date_text* argument is not (or cannot be converted to) a [text](/features/value-types#strings) value, then DATEVALUE returns the [`#VALUE!`](/features/error-types.md#value) error.
|
||||
* If the *date_text* argument represents a date outside the valid range (before December 31, 1899 or after December 31, 9999), then DATEVALUE returns the [`#VALUE!`](/features/error-types.md#value) error.
|
||||
* If the *date_text* argument cannot be recognized as a valid date format, then DATEVALUE returns the [`#VALUE!`](/features/error-types.md#value) error.
|
||||
<!--@include: ../markdown-snippets/error-type-details.txt-->
|
||||
|
||||
<!-- ## Details
|
||||
For more information on how IronCalc processes Date and Time functions and values, visit [Date and Time](/features/serial-numbers.md)
|
||||
|
||||
## Examples
|
||||
[See some examples in IronCalc](https://app.ironcalc.com/?example=datevalue).
|
||||
-->
|
||||
|
||||
## Links
|
||||
* See also IronCalc's [TIMEVALUE](/functions/date_and_time/timevalue.md) function for converting time text to serial numbers.
|
||||
* Visit Microsoft Excel's [DATEVALUE function](https://support.microsoft.com/en-us/office/datevalue-function-df8b07d4-7761-4a93-bc33-b7471bbff252) page.
|
||||
* Both [Google Sheets](https://support.google.com/docs/answer/3093039) and [LibreOffice Calc](https://wiki.documentfoundation.org/Documentation/Calc_Functions/DATEVALUE) provide versions of the DATEVALUE function.
|
||||
@@ -4,9 +4,42 @@ outline: deep
|
||||
lang: en-US
|
||||
---
|
||||
|
||||
# TIMEVALUE
|
||||
# TIMEVALUE function
|
||||
|
||||
::: warning
|
||||
**Note:** This draft page is under construction 🚧
|
||||
The TIMEVALUE function is implemented and available in IronCalc.
|
||||
:::
|
||||
## Overview
|
||||
TIMEVALUE is a function of the Date and Time category that converts a time stored as text to a [serial number](/features/serial-numbers.md) corresponding to a time value. The serial number represents time as a decimal fraction of a 24-hour day (e.g., 0.5 represents 12:00:00 noon).
|
||||
|
||||
## Usage
|
||||
### Syntax
|
||||
**TIMEVALUE(<span title="Text" style="color:#1E88E5">time_text</span>) => <span title="Number" style="color:#1E88E5">timevalue</span>**
|
||||
|
||||
### Argument descriptions
|
||||
* *time_text* ([text](/features/value-types#strings), required). A text string that represents a time in a known format. The text must represent a time between 00:00:00 and 23:59:59.
|
||||
|
||||
### Additional guidance
|
||||
* Date information in the *time_text* argument is ignored. TIMEVALUE processes only the time portion.
|
||||
* The function can handle various time formats, including both 12-hour and 24-hour formats, as well as text that includes both date and time information.
|
||||
|
||||
### Returned value
|
||||
TIMEVALUE returns a [number](/features/value-types#numbers) that represents the time as a [serial number](/features/serial-numbers.md). The serial number is a decimal fraction of a 24-hour day, where:
|
||||
* 0.0 represents 00:00:00 (midnight)
|
||||
* 0.5 represents 12:00:00 (midday)
|
||||
* 0.99999... represents 23:59:59 (just before midnight)
|
||||
|
||||
### Error conditions
|
||||
* In common with many other IronCalc functions, TIMEVALUE propagates errors that are found in its argument.
|
||||
* If no argument, or more than one argument, is supplied, then TIMEVALUE returns the [`#ERROR!`](/features/error-types.md#error) error.
|
||||
* If the value of the *time_text* argument is not (or cannot be converted to) a [text](/features/value-types#strings) value, then TIMEVALUE returns the [`#VALUE!`](/features/error-types.md#value) error.
|
||||
* If the *time_text* argument represents a time outside the valid range, then TIMEVALUE returns the [`#VALUE!`](/features/error-types.md#value) error.
|
||||
* If the *time_text* argument cannot be recognized as a valid time format, then TIMEVALUE returns the [`#VALUE!`](/features/error-types.md#value) error.
|
||||
<!--@include: ../markdown-snippets/error-type-details.txt-->
|
||||
|
||||
<!--
|
||||
## Examples
|
||||
[See some examples in IronCalc](https://app.ironcalc.com/?example=timevalue).
|
||||
-->
|
||||
|
||||
## Links
|
||||
* See also IronCalc's [DATEVALUE](/functions/date_and_time/datevalue.md) function for converting date text to serial numbers.
|
||||
* Visit Microsoft Excel's [TIMEVALUE function](https://support.microsoft.com/en-us/office/timevalue-function-0b615c12-33d8-4431-bf3d-f3eb6d186645) page.
|
||||
* Both [Google Sheets](https://support.google.com/docs/answer/3267350) and [LibreOffice Calc](https://wiki.documentfoundation.org/Documentation/Calc_Functions/TIMEVALUE) provide versions of the TIMEVALUE function.
|
||||
@@ -36,8 +36,8 @@ You can track the progress in this [GitHub issue](https://github.com/ironcalc/Ir
|
||||
| CSC | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| CSCH | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| DECIMAL | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| DEGREES | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| EVEN | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| DEGREES | <Badge type="info" text="Not implemented yet" /> | [DEGREES](math_and_trigonometry/degrees) |
|
||||
| EVEN | <Badge type="info" text="Not implemented yet" /> | [EVEN](math_and_trigonometry/even) |
|
||||
| EXP | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| FACT | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| FACTDOUBLE | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
@@ -49,9 +49,9 @@ You can track the progress in this [GitHub issue](https://github.com/ironcalc/Ir
|
||||
| ISO.CEILING | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| LCM | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| LET | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| LN | <Badge type="info" text="Available" /> | – |
|
||||
| LOG | <Badge type="info" text="Available" /> | – |
|
||||
| LOG10 | <Badge type="info" text="Available" /> | – |
|
||||
| LN | <Badge type="tip" text="Available" /> | – |
|
||||
| LOG | <Badge type="tip" text="Available" /> | – |
|
||||
| LOG10 | <Badge type="tip" text="Available" /> | – |
|
||||
| MDETERM | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| MINVERSE | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| MMULT | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
@@ -59,12 +59,12 @@ You can track the progress in this [GitHub issue](https://github.com/ironcalc/Ir
|
||||
| MROUND | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| MULTINOMIAL | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| MUNIT | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| ODD | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| ODD | <Badge type="info" text="Not implemented yet" /> | [ODD](math_and_trigonometry/odd) |
|
||||
| PI | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| POWER | <Badge type="tip" text="Available" /> | – |
|
||||
| PRODUCT | <Badge type="tip" text="Available" /> | – |
|
||||
| QUOTIENT | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| RADIANS | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| RADIANS | <Badge type="info" text="Not implemented yet" /> | [RADIANS](math_and_trigonometry/radians) |
|
||||
| RAND | <Badge type="tip" text="Available" /> | – |
|
||||
| RANDARRAY | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| RANDBETWEEN | <Badge type="tip" text="Available" /> | – |
|
||||
@@ -80,7 +80,7 @@ You can track the progress in this [GitHub issue](https://github.com/ironcalc/Ir
|
||||
| SIN | <Badge type="tip" text="Available" /> | [SIN](math_and_trigonometry/sin) |
|
||||
| SINH | <Badge type="tip" text="Available" /> | [SINH](math_and_trigonometry/sinh) |
|
||||
| SQRT | <Badge type="tip" text="Available" /> | – |
|
||||
| SQRTPI | <Badge type="info" text="Available" /> | – |
|
||||
| SQRTPI | <Badge type="tip" text="Available" /> | – |
|
||||
| SUBTOTAL | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| SUM | <Badge type="tip" text="Available" /> | – |
|
||||
| SUMIF | <Badge type="tip" text="Available" /> | – |
|
||||
|
||||
@@ -4,9 +4,40 @@ outline: deep
|
||||
lang: en-US
|
||||
---
|
||||
|
||||
# DEGREES
|
||||
# DEGREES function
|
||||
|
||||
::: warning
|
||||
🚧 This function is not yet available in IronCalc.
|
||||
[Follow development here](https://github.com/ironcalc/IronCalc/labels/Functions)
|
||||
:::
|
||||
## Overview
|
||||
DEGREES is a function of the Math and Trigonometry category that converts an angle measured in radians to an equivalent angle measured in degrees.
|
||||
|
||||
## Usage
|
||||
### Syntax
|
||||
**DEGREES(<span title="Number" style="color:#1E88E5">angle</span>) => <span title="Number" style="color:#1E88E5">degrees</span>**
|
||||
|
||||
### Argument descriptions
|
||||
* *angle* ([number](/features/value-types#numbers), required). The angle in radians that is to be converted to degrees.
|
||||
|
||||
### Additional guidance
|
||||
The conversion from radians to degrees is based on the relationship:
|
||||
$$
|
||||
1~\:~\text{radian} = \dfrac{180}{\pi}~\text{degrees} \approx 57.29577951~\text{degrees}
|
||||
$$
|
||||
|
||||
### Returned value
|
||||
DEGREES returns a [number](/features/value-types#numbers) that represents the value of the given angle expressed in degrees.
|
||||
|
||||
### Error conditions
|
||||
* In common with many other IronCalc functions, DEGREES propagates errors that are found in its argument.
|
||||
* If no argument, or more than one argument, is supplied, then DEGREES returns the [`#ERROR!`](/features/error-types.md#error) error.
|
||||
* If the value of the *angle* argument is not (or cannot be converted to) a [number](/features/value-types#numbers), then DEGREES returns the [`#VALUE!`](/features/error-types.md#value) error.
|
||||
<!--@include: ../markdown-snippets/error-type-details.txt-->
|
||||
|
||||
<!--
|
||||
## Examples
|
||||
[See some examples in IronCalc](https://app.ironcalc.com/?example=degrees).
|
||||
-->
|
||||
|
||||
## Links
|
||||
* For more information about angle conversions, visit Wikipedia's [Degree (angle)](https://en.wikipedia.org/wiki/Degree_(angle)) page.
|
||||
* See also IronCalc's [RADIANS](/functions/math_and_trigonometry/radians) function for converting degrees to radians.
|
||||
* Visit Microsoft Excel's [DEGREES function](https://support.microsoft.com/en-us/office/degrees-function-4d6ec4db-e694-4b94-ace0-1cc3f61f9ba1) page.
|
||||
* Both [Google Sheets](https://support.google.com/docs/answer/3093481) and [LibreOffice Calc](https://wiki.documentfoundation.org/Documentation/Calc_Functions/DEGREES) provide versions of the DEGREES function.
|
||||
@@ -4,9 +4,41 @@ outline: deep
|
||||
lang: en-US
|
||||
---
|
||||
|
||||
# EVEN
|
||||
# EVEN function
|
||||
|
||||
::: warning
|
||||
🚧 This function is not yet available in IronCalc.
|
||||
[Follow development here](https://github.com/ironcalc/IronCalc/labels/Functions)
|
||||
:::
|
||||
## Overview
|
||||
EVEN is a function of the Math and Trigonometry category that rounds a number up (away from zero) to the nearest even integer.
|
||||
|
||||
## Usage
|
||||
### Syntax
|
||||
**EVEN(<span title="Number" style="color:#1E88E5">number</span>) => <span title="Number" style="color:#1E88E5">even</span>**
|
||||
|
||||
### Argument descriptions
|
||||
* *number* ([number](/features/value-types#numbers), required). The number that is to be rounded to the nearest even integer.
|
||||
|
||||
### Additional guidance
|
||||
* EVEN rounds away from zero, meaning:
|
||||
* Positive numbers are rounded up to the next even integer.
|
||||
* Negative numbers are rounded down (toward negative infinity) to the next even integer.
|
||||
* If the *number* argument is already an even integer, EVEN returns it unchanged.
|
||||
* Since zero is considered an even number, the EVEN function returns 0 when *number* is 0.
|
||||
|
||||
### Returned value
|
||||
EVEN returns a [number](/features/value-types#numbers) that is the nearest even integer, rounded away from zero.
|
||||
|
||||
### Error conditions
|
||||
* In common with many other IronCalc functions, EVEN propagates errors that are found in its argument.
|
||||
* If no argument, or more than one argument, is supplied, then EVEN returns the [`#ERROR!`](/features/error-types.md#error) error.
|
||||
* If the value of the *number* argument is not (or cannot be converted to) a [number](/features/value-types#numbers), then EVEN returns the [`#VALUE!`](/features/error-types.md#value) error.
|
||||
<!--@include: ../markdown-snippets/error-type-details.txt-->
|
||||
|
||||
<!--
|
||||
## Examples
|
||||
[See some examples in IronCalc](https://app.ironcalc.com/?example=even).
|
||||
-->
|
||||
|
||||
## Links
|
||||
* For more information about even and odd numbers, visit Wikipedia's [Parity](https://en.wikipedia.org/wiki/Parity_(mathematics)) page.
|
||||
* See also IronCalc's [ODD](/functions/math_and_trigonometry/odd) function.
|
||||
* Visit Microsoft Excel's [EVEN function](https://support.microsoft.com/en-us/office/even-function-197b5f06-c795-4c1e-8696-3c3b8a646cf9) page.
|
||||
* Both [Google Sheets](https://support.google.com/docs/answer/3093409) and [LibreOffice Calc](https://wiki.documentfoundation.org/Documentation/Calc_Functions/EVEN) provide versions of the EVEN function.
|
||||
@@ -4,9 +4,41 @@ outline: deep
|
||||
lang: en-US
|
||||
---
|
||||
|
||||
# ODD
|
||||
# ODD function
|
||||
|
||||
::: warning
|
||||
🚧 This function is not yet available in IronCalc.
|
||||
[Follow development here](https://github.com/ironcalc/IronCalc/labels/Functions)
|
||||
:::
|
||||
## Overview
|
||||
ODD is a function of the Math and Trigonometry category that rounds a number up (away from zero) to the nearest odd integer.
|
||||
|
||||
## Usage
|
||||
### Syntax
|
||||
**ODD(<span title="Number" style="color:#1E88E5">number</span>) => <span title="Number" style="color:#1E88E5">odd</span>**
|
||||
|
||||
### Argument descriptions
|
||||
* *number* ([number](/features/value-types#numbers), required). The number that is to be rounded to the nearest odd integer.
|
||||
|
||||
### Additional guidance
|
||||
* ODD rounds away from zero, meaning:
|
||||
* Positive numbers are rounded up to the next odd integer.
|
||||
* Negative numbers are rounded down (toward negative infinity) to the next odd integer.
|
||||
* If the *number* argument is already an odd integer, ODD returns it unchanged.
|
||||
* Since zero is considered an even number, the ODD function returns 1 when *number* is 0.
|
||||
|
||||
### Returned value
|
||||
ODD returns a [number](/features/value-types#numbers) that is the nearest odd integer, rounded away from zero.
|
||||
|
||||
### Error conditions
|
||||
* In common with many other IronCalc functions, ODD propagates errors that are found in its argument.
|
||||
* If no argument, or more than one argument, is supplied, then ODD returns the [`#ERROR!`](/features/error-types.md#error) error.
|
||||
* If the value of the *number* argument is not (or cannot be converted to) a [number](/features/value-types#numbers), then ODD returns the [`#VALUE!`](/features/error-types.md#value) error.
|
||||
<!--@include: ../markdown-snippets/error-type-details.txt-->
|
||||
|
||||
<!--
|
||||
## Examples
|
||||
[See some examples in IronCalc](https://app.ironcalc.com/?example=odd).
|
||||
-->
|
||||
|
||||
## Links
|
||||
* For more information about even and odd numbers, visit Wikipedia's [Parity](https://en.wikipedia.org/wiki/Parity_(mathematics)) page.
|
||||
* See also IronCalc's [EVEN](/functions/math_and_trigonometry/even) function.
|
||||
* Visit Microsoft Excel's [ODD function](https://support.microsoft.com/en-us/office/odd-function-deae64eb-e08a-4c88-8b40-6d0b42575c98) page.
|
||||
* Both [Google Sheets](https://support.google.com/docs/answer/3093499) and [LibreOffice Calc](https://wiki.documentfoundation.org/Documentation/Calc_Functions/ODD) provide versions of the ODD function.
|
||||
@@ -4,9 +4,38 @@ outline: deep
|
||||
lang: en-US
|
||||
---
|
||||
|
||||
# RADIANS
|
||||
# RADIANS function
|
||||
|
||||
::: warning
|
||||
🚧 This function is not yet available in IronCalc.
|
||||
[Follow development here](https://github.com/ironcalc/IronCalc/labels/Functions)
|
||||
:::
|
||||
## Overview
|
||||
RADIANS is a function of the Math and Trigonometry category that converts an angle measured in degrees to an equivalent angle measured in radians.
|
||||
|
||||
## Usage
|
||||
### Syntax
|
||||
**RADIANS(<span title="Number" style="color:#1E88E5">angle</span>) => <span title="Number" style="color:#1E88E5">radians</span>**
|
||||
|
||||
### Argument descriptions
|
||||
* *angle* ([number](/features/value-types#numbers), required). The angle in degrees that is to be converted to radians.
|
||||
|
||||
### Additional guidance
|
||||
The conversion from degrees to radians is based on the relationship:
|
||||
$$
|
||||
1~\:~\text{degree} = \dfrac{\pi}{180}~\text{radians} \approx 0.01745329252~\text{radians}
|
||||
$$
|
||||
|
||||
### Returned value
|
||||
RADIANS returns a [number](/features/value-types#numbers) that represents the value of the given angle expressed in radians.
|
||||
|
||||
### Error conditions
|
||||
* In common with many other IronCalc functions, RADIANS propagates errors that are found in its argument.
|
||||
* If no argument, or more than one argument, is supplied, then RADIANS returns the [`#ERROR!`](/features/error-types.md#error) error.
|
||||
* If the value of the *angle* argument is not (or cannot be converted to) a [number](/features/value-types#numbers), then RADIANS returns the [`#VALUE!`](/features/error-types.md#value) error.
|
||||
<!--@include: ../markdown-snippets/error-type-details.txt-->
|
||||
<!--
|
||||
## Examples
|
||||
[See some examples in IronCalc](https://app.ironcalc.com/?example=radians).
|
||||
-->
|
||||
## Links
|
||||
* For more information about angle conversions, visit Wikipedia's [Radian](https://en.wikipedia.org/wiki/Radian) page.
|
||||
* See also IronCalc's [DEGREES](/functions/math_and_trigonometry/degrees) function for converting radians to degrees.
|
||||
* Visit Microsoft Excel's [RADIANS function](https://support.microsoft.com/en-us/office/radians-function-907f0ede-ef2e-4f7b-911a-015e2f8ab878) page.
|
||||
* Both [Google Sheets](https://support.google.com/docs/answer/3093481) and [LibreOffice Calc](https://wiki.documentfoundation.org/Documentation/Calc_Functions/RADIANS) provide versions of the RADIANS function.
|
||||
BIN
xlsx/tests/calc_tests/ACCRINT_ACCRINTM.xlsx
Normal file
BIN
xlsx/tests/calc_tests/ACCRINT_ACCRINTM.xlsx
Normal file
Binary file not shown.
BIN
xlsx/tests/calc_tests/DEGREES_RADIANS.xlsx
Normal file
BIN
xlsx/tests/calc_tests/DEGREES_RADIANS.xlsx
Normal file
Binary file not shown.
BIN
xlsx/tests/calc_tests/EVEN_ODD.xlsx
Normal file
BIN
xlsx/tests/calc_tests/EVEN_ODD.xlsx
Normal file
Binary file not shown.
Reference in New Issue
Block a user