SarthakKeshari / calc_for_everything

This repository aims to provide Calculators for educational, professional, scientific, health and well-being and other purposes.
https://calc-for-everything-psi.vercel.app
MIT License
116 stars 104 forks source link

Exponents solver #638

Closed wuhue closed 8 months ago

wuhue commented 8 months ago

Issue Id you have worked upon -

exponentsSolver

Briefly explain your program logic -

This code defines two state variables, input and result, using the useState hook to track user input and calculation results. The calculateExponent function handles the logic for calculating the exponent. It first attempts to convert the input to a floating-point number. If the conversion is successful, it uses the Math.exp function to calculate the exponent value and stores the result in the result state variable. If the conversion fails, it stores an error message in the result.

The rendering section includes a text field for entering numbers, a calculate button that calls the calculateExponent function when clicked, and a section for displaying the calculation result. The overall logic is for the user to input a number, click the calculate button, and the program will calculate the exponent of the input number and display it on the interface.

Screenshots(Attach 2 screenshots of your own input and output) -

image image


By raising this PR I affirm that -

SarthakKeshari commented 8 months ago

Congratulations 🎉 @wuhue on your contribution. Thanks for adding value to this repository. 😊

Project is live at - https://calc-for-everything-psi.vercel.app/