Skip to content

Commit d7626e3

Browse files
authored
Update Volume.js
1 parent 3931903 commit d7626e3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Maths/Volume.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const volCube = (length) => {
3939
const volCone = (radius, height) => {
4040
isNumber(radius, 'Radius')
4141
isNumber(height, 'Height')
42-
return (Math.PI * radius ** 2 * height/3)
42+
return (Math.PI * radius ** 2 * height/3.0)
4343
}
4444

4545
/*
@@ -50,7 +50,7 @@ const volPyramid = (baseLength, baseWidth, height) => {
5050
isNumber(baseLength, 'BaseLength')
5151
isNumber(baseWidth, 'BaseWidth')
5252
isNumber(height, 'Height')
53-
return (baseLength * baseWidth * height) / 3
53+
return (baseLength * baseWidth * height) / 3.0
5454
}
5555

5656
/*
@@ -91,7 +91,7 @@ const volPentagonalPrism = (pentagonalLength, pentagonalBaseLength, height) => {
9191
*/
9292
const volSphere = (radius) => {
9393
isNumber(radius, 'Radius')
94-
return (4/3 * PI * radius ** 3)
94+
return (4/3 * Math.PI * radius ** 3)
9595
}
9696

9797
/*
@@ -100,7 +100,7 @@ const volSphere = (radius) => {
100100
*/
101101
const volHemisphere = (radius) => {
102102
isNumber(radius, 'Radius')
103-
return (2 * PI * radius ** 3)/3
103+
return (2.0 * Math.PI * radius ** 3)/ 3.0
104104
}
105105

106106
const isNumber = (number, noName = 'number') => {

0 commit comments

Comments
 (0)