reset password
Author Message
smehrik
Posts: 14
Posted 12:00 Jan 25, 2018 |

Can the user enter the Int number or if its Int keeps asking until user enter the double number?

AND, how about negative Number for calculate square root, do we have to validate the negative value too?

jhurley
Posts: 207
Posted 12:36 Jan 25, 2018 |

You can accept an integer value as a double

Good point about the negative numbers.  You can validate to make the user enter positive values if you want, or just report whatever math.sqrt() does with negatives