File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff 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
25162516if ( number < 3 ) {
25172517 document . getElementById ( 'frustum-pyramid-volume' ) . innerText = 'It takes at least three sides to form a pyramid.' ;
You can’t perform that action at this time.
0 commit comments