If I’m using a function from the Math module, such as log10, do I need to call Math.log10(number) or can I do number.log10?
If I’m using a function from the Math module, such as log10, do I
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Numbers have no
log10method available by default, but you can extend theNumericclass to add that functionality:If you just want to use the methods without having to write
Mathall the time, you couldinclude Math, then you can calllog10directly: