Board index » off-topic » Real variables question
Hernan Lara
![]() Delphi Developer |
Hernan Lara
![]() Delphi Developer |
Real variables question2006-10-25 09:08:39 AM off-topic2 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 |
David Pratt
![]() Delphi Developer |
2006-10-25 09:33:46 AM
Re:Real variables question
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" < XXXX@XXXXX.COM >wrote in message QuoteHi, im new to pascal, i have used it for about 2 weeks in school. Im |
Markus Humm
![]() Delphi Developer |
2006-10-26 03:25:53 AM
Re:Real variables question
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 Markus {smallsort} |
Dr J R Stockton
![]() Delphi Developer |
2006-10-26 11:59:18 PM
Re:Real variables question
In message < XXXX@XXXXX.COM >, Wed, 25 Oct 2006 21:25:53,
Markus Humm < XXXX@XXXXX.COM >writes Quoteanother thing to consider is to use the data types extended or single -- (c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME. <URL:www.merlyn.demon.co.uk/>TP/BP/Delphi/&c., FAQqy topics & links; <URL:www.merlyn.demon.co.uk/clpb-faq.txt>RAH Prins : c.l.p.b mFAQ; <URL:garbo.uwasa.fi/pc/link/tsfaqp.zip>Timo Salmi's Turbo Pascal FAQ. |
Markus Humm
![]() Delphi Developer |
2006-10-27 02:35:58 AM
Re:Real variables question
Dr J R Stockton schrieb:
QuoteIn message < XXXX@XXXXX.COM >, Wed, 25 Oct 2006 21:25:53, friends will you? ;-) Greetings Markus |