Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
Nth root
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
This week in OPM!
by
wp
[
Today
at 01:59:33 pm]
FastCGI vs. CGI
by
Thaddy
[
Today
at 01:32:45 pm]
Testing Antropic
by
Tomxe
[
Today
at 12:46:14 pm]
Putting a new file on a w...
by
Roland57
[
Today
at 12:04:05 pm]
GTK3 is now the default w...
by
Thaddy
[
Today
at 10:22:34 am]
authentiacte through goog...
by
Thaddy
[
Today
at 09:12:56 am]
[SOLVED] Stopped compilin...
by
CM630
[
Today
at 08:41:58 am]
[CLOSED] Seeking performa...
by
Xenno
[
Today
at 08:11:26 am]
Slow app start on M5 MacB...
by
Thaddy
[
Today
at 08:08:00 am]
Lazarus Main not building...
by
Thaddy
[
Today
at 06:31:42 am]
Setting the CURSOR for th...
by
jamie
[
Today
at 02:16:55 am]
Windows 2026_7 update and...
by
jamie
[
Today
at 01:45:40 am]
TPeriodicTable
by
wp
[
Today
at 12:19:25 am]
FPC Unleashed (async/awai...
by
Fibonacci
[July 17, 2026, 08:26:50 pm]
I have made some progress...
by
onionmixer
[July 17, 2026, 08:08:34 pm]
How to connect to MariaDb...
by
jcmontherock
[July 17, 2026, 06:23:38 pm]
Accessing VRAM memory wit...
by
LemonParty
[July 17, 2026, 04:45:30 pm]
KOL4 Beta available.
by
Thaddy
[July 17, 2026, 04:45:13 pm]
docking IDE
by
Martin_fr
[July 17, 2026, 02:13:28 pm]
Engineering Software from...
by
jamie
[July 17, 2026, 12:51:57 pm]
[SOLVED] BitBtn Oddity
by
Petrus Vorster
[July 17, 2026, 09:05:55 am]
Difference between @ and ...
by
paule32
[July 17, 2026, 08:18:43 am]
Lazarus Bugfix Release 4....
by
papillon33
[July 17, 2026, 08:15:45 am]
Many recent books on Laza...
by
Khrys
[July 17, 2026, 06:35:48 am]
Isn’t this funny?
by
n7800
[July 16, 2026, 11:57:09 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Nth root (Read 4884 times)
Don_Zagor
New Member
Posts: 25
Nth root
«
on:
December 30, 2018, 05:31:39 pm »
How can i find the Nth root in Pascal?
Logged
Blaazen
Hero Member
Posts: 3241
POKE 54296,15
Re: Nth root
«
Reply #1 on:
December 30, 2018, 05:47:53 pm »
For the square root use sqrt();, for any n use power() from unit Math, e.g.
Code: Pascal
[Select]
[+]
[-]
power
(
64
,
1
/
3
)
;
for the third root etc.
Logged
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21
Try Eye-Candy Controls:
https://sourceforge.net/projects/eccontrols/files/
Bart
Hero Member
Posts: 5744
Re: Nth root
«
Reply #2 on:
December 30, 2018, 05:48:22 pm »
Nth root of x equals x^(1/n) IIRC.
Power(x, 1/n) (unit Math) might do the trick?
Bart
Logged
Blaazen
Hero Member
Posts: 3241
POKE 54296,15
Re: Nth root
«
Reply #3 on:
December 30, 2018, 05:56:46 pm »
This works too:
Code: Pascal
[Select]
[+]
[-]
64
**
(
1
/
3
)
but unit Math must be in
uses
since operator ** is overloaded there.
Logged
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21
Try Eye-Candy Controls:
https://sourceforge.net/projects/eccontrols/files/
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
Nth root
TinyPortal
© 2005-2018