Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Free Pascal
»
Windows
(Moderators:
FPK
,
Tomas Hajny
) »
About DIV and ROUND
Free Pascal
Website
Downloads
Wiki
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Bugtracker
IRC channel
Latest SVN
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Linux daemon's AccessViol...
by
auRazor
[
Today
at 06:00:26 am]
Linux daemon's AccessViol...
by
auRazor
[
Today
at 05:58:42 am]
Library switches
by
anonymousstranger
[
Today
at 05:42:36 am]
Compiling on unbutu 20.10...
by
auRazor
[
Today
at 05:16:49 am]
Source for Lazarus IDE Co...
by
Trenatos
[
Today
at 04:58:01 am]
Code in If statement not ...
by
Handoko
[
Today
at 04:53:40 am]
"ASpell" spell checker
by
dbannon
[
Today
at 04:24:07 am]
Problem with scrolling im...
by
Handoko
[
Today
at 03:57:58 am]
TCombobox dropUPlist?
by
Handoko
[
Today
at 02:48:57 am]
FTP server not responding
by
dbannon
[
Today
at 02:48:36 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: About DIV and ROUND (Read 3210 times)
SaintMichael57
New Member
Posts: 18
About DIV and ROUND
«
on:
February 27, 2018, 09:05:26 pm »
Dear FreePascal Community:
Why am I getting the following error messages?
ROUND(Weight); error: Illegal expression.
(Weight DIV 2) error: Operator not overloaded: "Real" div "shortint"
Logged
djzepi
New Member
Posts: 36
Re: About DIV and ROUND
«
Reply #1 on:
February 27, 2018, 09:33:33 pm »
Check yours code!
Code: Pascal
[Select]
[+]
[-]
var
Weight
:
double
;
w1
,
w2
:
integer
;
Code: Pascal
[Select]
[+]
[-]
begin
// ...
w1
:
=
round
(
Weight
)
;
w2
:
=
w1
div
2
;
end
;
See also
http://wiki.freepascal.org/Div
http://wiki.freepascal.org/Round
http://wiki.freepascal.org/Becomes
http://wiki.freepascal.org/Data_type
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Free Pascal
»
Windows
(Moderators:
FPK
,
Tomas Hajny
) »
About DIV and ROUND
TinyPortal
© 2005-2018