In this particular video when the instructor has tested the isPrime function for 2147483618,shouldn’t it show no it is not,rather the output is yes it is.
And also what does this statement do exactly?
return b[i]==1?true:false in the bool isPrime function
Large prime check(using sieve)
hello @armaanbhardwaj23
he tested for 2147483647 which is a prime number hence output was yes
this is ternary operator. here this statemnt will true if b[i]==1
otherwise it will return false
I know about the ternary operator but am not sure about the use of the b[i] in this statement,what does it signify basically?Does it mean that if the bit at the i’th number is 1,then return true otherwise false?
yeah . … . right …
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
hi aman i think armaan is saying right for 21474831618 it is showing prime which is wrong