CalcDiverse icon indicating copy to clipboard operation
CalcDiverse copied to clipboard

Bug : Fix negative input in Logarithm Calculator

Open Aarzookhunger opened this issue 9 months ago • 1 comments

Fixes Issue🛠️

Closes #630

Description👨‍💻

The base input while calculating the log should be positive and not 1. This issue has been fixed by inculcating the necessary changes in index.html file in the input tag and using validateBaseInput function.

Also the number whose log is being calculated should be positive which has been fixed on the similar lines by making changes in the input tag.

For more detailed information, review the changes made section.

Type of change📄

function validateBaseInput(base) {
	const errorElement = document.getElementById('baseError');
	if (base.value == 1) {
		errorElement.style.display = 'inline';
	} else {
		errorElement.style.display = 'none';
	}
}
  • [] Bug fix (non-breaking change which fixes an issue)

How this has been tested✅

Tested on my PC locally by entering the inputs that resulted in bug such as:-

  • 1 as the base input
  • negative number as base and the number input

The screenshot has been attached for the same which showcases that testing has been done and the code works fine as expected.

Checklist✅

  • [✅ ] My code follows the style guidelines of this project
  • [✅ ] I have performed a self-review of my own code
  • [] I have commented my code, particularly in hard-to-understand areas
  • [✅] I have added demonstration in the form of GIF/video file
  • [✅ ] I am an Open Source Contributor

Screenshots/GIF📷

LogarithmBaseError

Aarzookhunger avatar May 19 '24 20:05 Aarzookhunger

Deploy Preview for calcdiverse ready!

Name Link
Latest commit 3613dbc1efcc9e17997211d91baa7e737ecccb74
Latest deploy log https://app.netlify.com/sites/calcdiverse/deploys/664a5de2be70b20008eaf1b2
Deploy Preview https://deploy-preview-774--calcdiverse.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar May 19 '24 20:05 netlify[bot]