54 div 3 整除 The following kinds of casts are allowed: - Ordinal or pointer type to another ordinal or pointer type - A character, string, array of character or pchar to a string - An ordinal, real, string or variant to a variant - A variant to an ordinal, real, string or variant - A variable reference to any type of the same size. Note that casting real types to integer can be performed with the standard functions Trunc and Round.There are other transfer functions like Ord and Chr that might make your intention clearer. program Produce;begin Writeln( Integer(Pi) ); end.This programmer thought he could cast a floating point constant to Integer, like in C. program Solve;begin Writeln( Trunc(Pi) ); end.In Pascal, we have separate Transfer functions to convert floating point values to integer.
Trunc:截断取整.
意,一般我都是在SQL2000中解決的。下面的代碼可以達到你要求的功能,就
是繁了一些。var Int_Value:integer;
J_RealValue:Real;
begin
J_RealValue := 123.4332;
Int_Value := strtoint(Floattostr(int(J_RealValue)));
end;
Writeln( Integer(Pi) );
end.This programmer thought he could cast a floating point constant to Integer, like in C. program Solve;begin
Writeln( Trunc(Pi) );
end.In Pascal, we have separate Transfer functions to convert floating point values to integer.
浮点数用 /
================================================================
一颗红心向前看,为了革命两茫然,不好意思才囊尽,只能说上一点点。
★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
★ ★
★ ★
★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
================================================================
round哦