Groups > Borland > Turbo Pascal > Re: Real variables question




Re: Real variables question

Re: Real variables question
Tue, 24 Oct 2006 20:33:46 -050
Write (V1:minimun width:Decimal places);
 So if  you want to print a variable in a space 10 cahrs wide to two decimal 
places, you would use:
  Write(V1:10:2);

This also works with writeln.

"Hernan Lara" <hernanlara@hotmail.com> wrote in message 
news:453ebc1f$1@newsgroups.borland.com...
> Hi, im new to pascal, i have used it for about 2 weeks in school.  Im 
> having a problem dealing with "real' numeric variables.  Everytime i
run 
> my program and write the value of a "real" variable i get it in
exponent 
> format; is there any way to get over this and write the numbers without 
> the exponent?
> Thanks
> 

Post Reply
Real variables question
Tue, 24 Oct 2006 21:08:39 -040
Hi, im new to pascal, i have used it for about 2 weeks in school.  Im having 
a problem dealing with "real' numeric variables.  Everytime i run my
program 
and write the value of a "real" variable i get it in exponent format;
is 
there any way to get over this and write the numbers without the exponent?
Thanks 

Post Reply
Re: Real variables question
Wed, 25 Oct 2006 21:25:53 +020
Hello,

another thing to consider is to use the data types extended or single
instead, as they can use the FPU and are standard where real is a
Borland construct.

Using the other "real" types requires this as the first line in your
program:

{$N+,E+}

This enables FPU usage and emulation.

Greetings

Post Reply
Re: Real variables question
Thu, 26 Oct 2006 16:59:18 +010
In message <453fba07@newsgroups.borland.com>, Wed, 25 Oct 2006 21:25:53,
Markus Humm <markus.humm@freenet.de> writes

>another thing to consider is to use the data types extended or single
>instead, as they can use the FPU and are standard where real is a
>Borland construct.
>
>Using the other "real" types requires this as the first line in
your
>program:
>
>{$N+,E+}
>
>This enables FPU usage and emulation.

That first line is NOT *required*; one can also do it by settings in one
of the IDE menus or by options for the command-line compiler.

-- 
 (c) John Stockton, Surrey, UK.  ?@merlyn.demon.co.uk   Turnpike v6.05   MIME.
  <URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics
& links;
  <URL:http://www.merlyn.demon.co.uk/clpb-faq.txt>   RAH Prins : c.l.p.b
mFAQ;
Post Reply
Re: Real variables question
Thu, 26 Oct 2006 20:35:58 +020
Dr J R Stockton schrieb:
> In message <453fba07@newsgroups.borland.com>, Wed, 25 Oct 2006
21:25:53,
> Markus Humm <markus.humm@freenet.de> writes
> 
[snip]
> 
> That first line is NOT *required*; one can also do it by settings in one
> of the IDE menus or by options for the command-line compiler.
> 
Yes one can, but if you share the code with another person who doesn't
have these settings and doesn't even know about them you won't make
friends will you? ;-)

Greetings

Post Reply
about | contact