From 2911106c7fbe30a75777b9629e35c4369f849c20 Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Fri, 16 Jun 2023 21:39:03 +0000 Subject: [PATCH] Documentation for 5704841875e3369942f9403bd1964fcc3a8867dd --- d8/dd5/check__factorial_8cpp.html | 138 +++++++----------- d8/dd5/check__factorial_8cpp.js | 4 +- ...83bb8ccf42aaf7375a83e91490eda1e_cgraph.map | 7 + ...83bb8ccf42aaf7375a83e91490eda1e_cgraph.md5 | 1 + ...83bb8ccf42aaf7375a83e91490eda1e_cgraph.svg | 82 +++++++++++ ...8ccf42aaf7375a83e91490eda1e_cgraph_org.svg | 57 ++++++++ ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.map | 5 - ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 | 1 - ...8ec9ad42717780d6caaff9d3d6977f9_cgraph.svg | 64 -------- ...ad42717780d6caaff9d3d6977f9_cgraph_org.svg | 39 ----- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 12 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 50 +++++-- ...b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg | 50 +++++-- dd/d47/namespacemath.html | 56 +++++++ dd/d47/namespacemath.js | 1 + dir_296d53ceaeaa7e099814a6def439fe8a.html | 2 +- files.html | 2 +- globals_func_i.html | 1 - globals_func_t.html | 2 +- globals_i.html | 1 - globals_t.html | 2 +- namespacemembers.html | 1 + namespacemembers_func.html | 1 + navtreedata.js | 6 +- navtreeindex0.js | 52 +++---- navtreeindex1.js | 46 +++--- navtreeindex10.js | 2 +- navtreeindex11.js | 70 ++++----- navtreeindex12.js | 20 +-- navtreeindex13.js | 6 +- navtreeindex14.js | 1 + navtreeindex2.js | 16 +- navtreeindex4.js | 14 +- navtreeindex5.js | 14 +- navtreeindex6.js | 30 ++-- navtreeindex7.js | 30 ++-- navtreeindex8.js | 22 +-- navtreeindex9.js | 10 +- search/all_15.js | 2 +- search/all_a.js | 2 +- search/functions_14.js | 2 +- search/functions_9.js | 2 +- 43 files changed, 518 insertions(+), 410 deletions(-) create mode 100644 d8/dd5/check__factorial_8cpp_a483bb8ccf42aaf7375a83e91490eda1e_cgraph.map create mode 100644 d8/dd5/check__factorial_8cpp_a483bb8ccf42aaf7375a83e91490eda1e_cgraph.md5 create mode 100644 d8/dd5/check__factorial_8cpp_a483bb8ccf42aaf7375a83e91490eda1e_cgraph.svg create mode 100644 d8/dd5/check__factorial_8cpp_a483bb8ccf42aaf7375a83e91490eda1e_cgraph_org.svg delete mode 100644 d8/dd5/check__factorial_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.map delete mode 100644 d8/dd5/check__factorial_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 delete mode 100644 d8/dd5/check__factorial_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg delete mode 100644 d8/dd5/check__factorial_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph_org.svg diff --git a/d8/dd5/check__factorial_8cpp.html b/d8/dd5/check__factorial_8cpp.html index 7e1500ecd..5a6acf23c 100644 --- a/d8/dd5/check__factorial_8cpp.html +++ b/d8/dd5/check__factorial_8cpp.html @@ -98,12 +98,13 @@ $(document).ready(function(){initNavTree('d8/dd5/check__factorial_8cpp.html','..
A simple program to check if the given number is a factorial of some number or not. +
A simple program to check if the given number is a factorial of some number or not. More...
#include <cassert>#include <iostream>+Namespaces | |
| namespace | math |
| for IO operations | |
Functions | |
| bool | is_factorial (uint64_t n) |
| void | tests () |
| bool | math::is_factorial (uint64_t n) |
| Function to check if the given number is factorial of some number or not. | |
| static void | tests () |
| Self-test implementations. | |
| int | main () |
| Main function. | |
A simple program to check if the given number is a factorial of some number or not.
- +A simple program to check if the given number is a factorial of some number or not.
+A factorial number is the sum of k! where any value of k is a positive integer. https://www.mathsisfun.com/numbers/factorial.html
+| bool is_factorial | -( | -uint64_t | -n | ) | -- |
Function to check if the given number is factorial of some number or not.
| n | number to be checked. |
Main function
Main function.
+
|
+ +static | +
Test function
Self-test implementations.
+| bool math::is_factorial | +( | +uint64_t | +n | ) | ++ |
Function to check if the given number is factorial of some number or not.
+| n | number to be checked. |
this loop is basically a reverse factorial calculation, where instead of multiplying we are dividing. We start at i = 2 since i = 1 has no impact division wise
+if n was the sum of a factorial then it should be divided until it becomes 1
+