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
TLazSerial : serial port ...
by
CM630
[
Today
at 07:55:15 am]
Recompiled IDE with LCLRe...
by
AlexTP
[
Today
at 05:09:56 am]
Hashing pointers by using...
by
ALLIGATOR
[
Today
at 04:41:23 am]
exception external SIGSEG...
by
billjtx
[
Today
at 01:06:50 am]
Commerce website written ...
by
Joanna
[
Today
at 01:00:28 am]
So many "newbies"
by
Curt Carpenter
[
Today
at 12:40:11 am]
TaurusTLS 1.0.0.25 beta 2...
by
LeP
[December 12, 2025, 09:21:31 pm]
Single / Double / Float s...
by
tetrastes
[December 12, 2025, 09:10:39 pm]
Publish a LAMW app in F-d...
by
spacepascal
[December 12, 2025, 09:00:41 pm]
OS/2 Warp 4 problem with ...
by
PascalDragon
[December 12, 2025, 08:30:23 pm]
Introducing PasBuild 1.0....
by
PascalDragon
[December 12, 2025, 08:20:32 pm]
Convert string with Key-V...
by
Bart
[December 12, 2025, 07:28:04 pm]
The TChromeTabs component...
by
1-berto
[December 12, 2025, 07:02:28 pm]
Military Grade Directives
by
Warfley
[December 12, 2025, 05:44:12 pm]
connecting to mariadb
by
marcov
[December 12, 2025, 04:13:37 pm]
TIBDataSet "Closing"? on ...
by
RedOctober
[December 12, 2025, 03:09:07 pm]
How can I make a safe app...
by
marcov
[December 12, 2025, 02:58:10 pm]
fpsockets error: 10047
by
Warfley
[December 12, 2025, 01:32:51 pm]
FPC 3.2.4-rc1 available
by
marcov
[December 12, 2025, 10:47:38 am]
[SOLVED] Lazreport. Multi...
by
Petrus Vorster
[December 12, 2025, 09:27:32 am]
Has anyone installed TeeB...
by
egsuh
[December 12, 2025, 06:34:29 am]
[SOLVED] Program compiles...
by
Schmitty2005
[December 11, 2025, 07:35:39 pm]
[SOLVED] Need help conver...
by
srvaldez
[December 11, 2025, 01:52:33 pm]
SpkToolbar custom update
by
wp
[December 11, 2025, 01:48:16 pm]
Is FPGUI still active?
by
BSaidus
[December 11, 2025, 01:25:31 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Nth root (Read 4612 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: 5649
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