?
Solved

Operations

Posted on 1999-06-28
7
Medium Priority
?
122 Views
Last Modified: 2010-04-06
I want to write code for :
1-square of a number
2-square root of a number
3-multiplication and division with decimals
Thanks
Dragos
I use Delphi 4 pro
0
Comment
Question by:Eftodi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 

Author Comment

by:Eftodi
ID: 1384923
Edited text of question.
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 30 total points
ID: 1384924
hi Eftodi,

1-square of a number -> SQR
2-square root of a number -> SQRT
3-multiplication and division with decimals -> * /

meikl
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1384925
hi again Eftodi,

some samples

1-square of a number -> SQR -> SQR(4) -> 16
X := SQR(4); //X=16

2-square root of a number -> SQRT -> SQRT(16) -> 4
X := SQRT(16); //X=4

3-multiplication and division with decimals -> * / > 1.2*1.2 = 1.44; 2.4 / 1.2 = 2;
X := 1.2*1.2; //X=1.44
X := 2.4 / 1.2; //X := 2;

meikl
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:Eftodi
ID: 1384926
The problem it is NOT solved
Declarations of :
 Var
- for decimals numbers for example
......
Thanks anyway
Dragos
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1384927
hi Eftodi,

well, vartypes, which can hold decimals

var
  X : Extended; or
  X : Single; or
  X : Double; or
  X : Currency; or
  X : Real;  //Maybe this is not supported by D4 -> Type Real48;

meikl
0
 

Author Comment

by:Eftodi
ID: 1384928
Hi
For example :
a=-b/2-sqrt((sqr(b/2)-c)
I have some problem with the declaration of:
Var
Thanks
Dragos
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1384929
hi dragos,

a must be a type from above
b and c can be integer if no decimals, otherwise dito

sqr & sqrt returns a type extended, but will automatically transformed
to a double if a for example a type double.

meikl
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question