2245
BigRational::from_integer(BigInt::from(108))
- ((BigRational::from_integer(BigInt::from(815))
- BigRational::from_integer(BigInt::from(1500)) / z)
/ y)
}
fn big_calc(turns: usize) -> BigRational
{
let mut x: Vec<BigRational> = vec![BigRational::from_float(4.0).unwrap(), BigRational::from_float(4.25).unwrap(),];
(2..turns + 1).for_each(|number|
{
x.push(rec_big(x[number - 1].clone(), x[number - 2].clone()));
});
x[turns].clone()
}
Example 2:
On February 25, 1991, during the eve of the Iraqi invasion of Saudi Arabia, a Scud missile fired
from Iraqi positions hit a US Army barracks in Dhahran, Saudi Arabia. It miscalculated time and
killed 28 people [REF-1190].
Example 3:
Sleipner A, an offshore drilling platform in the North Sea, was incorrectly constructed with an
underestimate of 50% of strength in a critical cluster of buoyancy cells needed for construction.
This led to a leak in buoyancy cells during lowering, causing a seismic event of 3.0 on the Richter
Scale and about $700M loss [REF-1281].
Observed Examples
Reference Description
CVE-2018-16069 Chain: series of floating-point precision errors (CWE-1339) in a web browser
rendering engine causes out-of-bounds read (CWE-125), giving access to
cross-origin data
https://www.cve.org/CVERecord?id=CVE-2018-16069
CVE-2017-7619 Chain: rounding error in floating-point calculations (CWE-1339) in image
processor leads to infinite loop (CWE-835)
https://www.cve.org/CVERecord?id=CVE-2017-7619
CVE-2021-29529 Chain: machine-learning product can have a heap-based buffer overflow
(CWE-122) when some integer-oriented bounds are calculated by using
ceiling() and floor() on floating point values (CWE-1339)
https://www.cve.org/CVERecord?id=CVE-2021-29529
CVE-2008-2108 Chain: insufficient precision (CWE-1339) in random-number generator causes
some zero bits to be reliably generated, reducing the amount of entropy
(CWE-331)
https://www.cve.org/CVERecord?id=CVE-2008-2108
CVE-2006-6499 Chain: web browser crashes due to infinite loop - "bad looping logic [that relies
on] floating point math [CWE-1339] to exit the loop [CWE-835]"
https://www.cve.org/CVERecord?id=CVE-2006-6499
MemberOf Relationships
This MemberOf relationships table shows additional CWE Catgeories and Views that reference this
weakness as a member. This information is often useful in understanding where a weakness fits
within the context of external information sources.
Nature Type ID Name Page
MemberOf 1408 Comprehensive Categorization: Incorrect Calculation 1400 2534
References
[REF-1186]"Is COBOL holding you hostage with Math?". 2018 July 8. < https://medium.com/thetechnical-
archaeologist/is-cobol-holding-you-hostage-with-math-5498c0eb428b >.
CWE Version 4.14
CWE-1341: Multiple Releases of Same Resource or Handle
CWE-1341: Multiple Releases of Same Resource or Handle