Tagged articles
4 articles
Page 1 of 1
php Courses
php Courses
Aug 19, 2023 · Backend Development

How to Use PHP's sqrt() Function to Calculate Square Roots

This article explains the PHP sqrt() function, demonstrates how to compute square roots for positive and negative numbers, shows how to cast the result to an integer, and highlights important usage considerations with clear code examples.

PHPcomplex numbersfunction
0 likes · 5 min read
How to Use PHP's sqrt() Function to Calculate Square Roots
21CTO
21CTO
Oct 17, 2021 · Fundamentals

Mastering Interview Math: Implement a Custom Square Root Function Without Libraries

This article explores how to solve a common interview coding challenge—implementing a square‑root function without using library calls—by discussing problem analysis, linear and binary‑search approaches, optimization techniques, testing strategies, and the broader skills interviewers aim to assess.

Binary Searchalgorithmcoding-challenge
0 likes · 15 min read
Mastering Interview Math: Implement a Custom Square Root Function Without Libraries
Laravel Tech Community
Laravel Tech Community
Feb 28, 2021 · Backend Development

PHP sqrt() Function – Returns the Square Root

The PHP sqrt() function returns the square root of a given float argument, returning NaN for negative inputs; the documentation details its syntax, parameter description, return value, and provides example code demonstrating usage with numbers like 9 and 10.

mathsqrt
0 likes · 1 min read
PHP sqrt() Function – Returns the Square Root
Programmer DD
Programmer DD
Dec 17, 2018 · Fundamentals

How to Compute √2 Efficiently: Binary Search, Newton’s Method, and C Tricks

Learn multiple techniques to calculate the square root of 2—including binary search, Newton’s iteration, and a clever C library implementation—through clear explanations, step‑by‑step illustrations, and full JavaScript and C code examples that reveal the underlying mathematics and performance considerations.

Binary SearchNewton's methodNumerical Methods
0 likes · 4 min read
How to Compute √2 Efficiently: Binary Search, Newton’s Method, and C Tricks