Skip to content

Commit c8ff6ef

Browse files
authored
Update index.html
1 parent badfb29 commit c8ff6ef

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2166,7 +2166,7 @@ <h6 style="font-size:160%;margin:7px">Area of a circle</h6>
21662166
const topRadius = parseFloat(document.getElementById('frustum-cone-top-radius').value);
21672167
const height = parseFloat(document.getElementById('frustum-cone-height').value);
21682168

2169-
if (isNaN(baseRadius) || isNaN(topRadius) || isNaN(height)) {
2169+
if (isNaN(baseRadius) || isNaN(topRadius) || isNaN(height) || baseRadius === 0 || topRadius === 0) {
21702170
document.getElementById('frustum-cone-volume').innerText = '';
21712171
return;
21722172
}
@@ -2508,10 +2508,10 @@ <h6 style="font-size:160%;margin:7px">Area of a circle</h6>
25082508
const topLength = parseFloat(document.getElementById('frustum-pyramid-top-edge-length').value);
25092509
const height = parseFloat(document.getElementById('frustum-pyramid-height').value);
25102510

2511-
if (isNaN(number) || isNaN(baseLength) || isNaN(topLength) || isNaN(height)) {
2511+
if (isNaN(number) || isNaN(baseLength) || isNaN(topLength) || isNaN(height) || baseLength === 0 || topLength === 0) {
25122512
document.getElementById('frustum-pyramid-volume').innerText = '';
25132513
return;
2514-
}
2514+
}
25152515

25162516
if ( number < 3) {
25172517
document.getElementById('frustum-pyramid-volume').innerText = 'It takes at least three sides to form a pyramid.';

0 commit comments

Comments
 (0)