Back to Browse

Math.round() and Math.rint() | Java Programming | Computer Applications

517 views
Nov 19, 2021
37:24

Chapters 0:00 Introduction 12:32 Numbers whose fractional part is less than 5 17:26 Numbers whose fractional part is greater than 5 21:19 Practice Time 24:12 Numbers whose fractional part is 5 31:53 Expln with Number Line 36:32 An Interesting question (PS. Due to technical issues I could not include the recording for negative numbers in the section 'numbers whose fractional part is 5'. But I have explained both positive and negative in the second last section. Moreover I am including my notes in the description) ✅Numbers whose fractional part is less than 5 These include numbers like 1.4, 2.3, -6.2, 9.0, -3.3, etc. Both Math.round() and Math.rint() return the integral part for positve as well as negative numbers. ✅Numbers whose fractional part is greater than 5 These include numbers like 1.6, 2.8, -6.9, 9.7, -8.8, etc. Both Math.round() and Math.rint() return the integral part + 1 for positive numbers and integral part - 1 for negative numbers. ✅Numbers whose fractional part is equal to 5 These include numbers like 1.5, 2.5, -6.5, 9.5, -15.5, etc. 1. Positive numbers i. Odd numbers - Math.round() and Math.rint() return the integral part + 1. ii. Even numbers - Math.round() returns the integral part + 1 while Math.rint() returns the integral part. 2. Negative numbers i. Odd numbers - Math.round() returns the integral part while Math.rint() returns the integral part - 1. ii. Even numbers - Math.round() and Math.rint() return the integral part.

Download

0 formats

No download links available.

Math.round() and Math.rint() | Java Programming | Computer Applications | NatokHD