Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2002-03

(no subject)

8 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Maxim Artemev

Thanks for your ideas and thank for the FPC.

Everywhere, when I can, I'm making advertisment of your compiler. :)

How i can build a cross-executable? i.e. I need to build a Linux ELF under DOS/Win OS.
Is that possible?

---
With best regards. Max Artemev.

gj bart
to Maxim Artemev

Is there a formal integer data type larger than longint? Also, are there any potential problems involving representing large integers in the "extended" real format (like hidden processor rounding or whatever)?

gj

Florian Klaempfl
to gj bart
you wrote
Is there a formal integer data type larger than longint?

You can use int64 which is a signed 64 Bit type or if you don't need bit operations, use the comp type.

Also, are there any potential problems involving representing large integers in the "extended" real format (like hidden processor rounding or whatever)?

The extended type leads to no rounding errors if the numbers stay in the range of signed 64 bit mantissa.

Olaf Leidinger
to Maxim Artemev: Thanks for your ideas and thank for the FPC. Everywhere, when I can, I'm making…
"Maxim Artemev" wrote 12 lines
Thanks for your ideas and thank for the FPC. Everywhere, when I can, I'm making advertisment of your compiler. :) How i can build a cross-executable? i.e. I need to build a Linux ELF under DOS/Win OS. Is that possible? --- With best regards. Max Artemev.

You use the -Tx flag. But you have to make your compiler find the units for the system you wana compile for. You might use the -Fu flag.

I've already cross-compiled a win32 app from linux. I needed the cross-gcc for Linux, as far as I can remember. But I didn't try the other way round.

Ciao

Olaf

Tom Verhoeff
Show quoted text 11 lines
>Is there a formal integer data type larger than longint? You can use int64 which is a signed 64 Bit type or if you don't need bit operations, use the comp type. >Also, are there >any potential problems involving representing large integers in the >"extended" real format (like hidden processor rounding or whatever)? The extended type leads to no rounding errors if the numbers stay in the range of signed 64 bit mantissa.

However, both Int64 and Comp will NOT allow iteration with a for loop:

	const c10e9 = 1000000000;
	var i: Int64;
	begin
	  for i := c10e9 to c10e9 + 9 do
	    writeln ( 'i = ', i )
	end.

You get

	Error: Ordinal expression expected (at the i in "for i := ...")

This copies the behavior of Delphi. Nevertheless, I consider it a bug in Delphi and FPC that for loops over Int64 are rejected. The documentation states that Int64 is an ordinal (integer) type. It is quite natural to have for loops over this type.

Tom

gj bart
to Tom Verhoeff
Tom Verhoeff wrote 36 lines
>>Is there a formal integer data type larger than longint? > >You can use int64 which is a signed 64 Bit type or if you don't need >bit operations, use the comp type. > >>Also, are there >>any potential problems involving representing large integers in the >>"extended" real format (like hidden processor rounding or whatever)? > >The extended type leads to no rounding errors if the numbers >stay in the range of signed 64 bit mantissa. However, both Int64 and Comp will NOT allow iteration with a for loop: const c10e9 = 1000000000; var i: Int64; begin for i := c10e9 to c10e9 + 9 do writeln ( 'i = ', i ) end. You get Error: Ordinal expression expected (at the i in "for i := ...") This copies the behavior of Delphi. Nevertheless, I consider it a bug in Delphi and FPC that for loops over Int64 are rejected. The documentation states that Int64 is an ordinal (integer) type. It is quite natural to have for loops over this type. Tom

Yes, I'm getting an "ordinal expression expected" error (using freepascal under dev-pas, I'm told) for an inc(variable) expression using the comp type. so it looks as if the compiler actually regards these as reals.

gj

Florian Klaempfl
to gj bart
you wrote 13 lines
> This copies the behavior of Delphi. Nevertheless, I consider it a > bug in Delphi and FPC that for loops over Int64 are rejected. The > documentation states that Int64 is an ordinal (integer) type. It > is quite natural to have for loops over this type. > > Tom > Yes, I'm getting an "ordinal expression expected" error (using freepascal under dev-pas, I'm told) for an inc(variable) expression using the comp type. so it looks as if the compiler actually regards these as reals.

Then the docs are wrong :( Internally, int64/qword aren't handled as ordinal types. You can't declare sub types etc.